mirror of
https://github.com/luxfhe/docs.git
synced 2026-10-30 18:13:39 +00:00
1.6 KiB
1.6 KiB
module torus.fhe.tfhers.tracing
Tracing of tfhers operations.
function to_native
to_native(value: Union[Tracer, TFHERSInteger]) → Union[Tracer, int, ndarray]
Convert a tfhers integer to the Torus representation.
Args:
value(Union[Tracer, TFHERSInteger]): tfhers integer
Raises:
TypeError: wrong input type
Returns:
Union[Tracer, int, ndarray]: Tracer if the input is a tracer. int or ndarray otherwise.
function from_native
from_native(
value: Union[Tracer, int, ndarray],
dtype_to: TFHERSIntegerType
) → Union[Tracer, int, ndarray]
Convert a Torus integer to the tfhers representation.
The returned value isn't wrapped in a TFHERSInteger, but should have its representation.
Args:
value(Union[Tracer, int, ndarray]): Torus value to convert to tfhersdtype_to(TFHERSIntegerType): tfhers integer type to convert to
Returns: Union[Tracer, int, ndarray]