# module `concrete.fhe.tracing.tracer` Declaration of `Tracer` class. --- ## class `Tracer` Tracer class, to create computation graphs from python functions. ### method `__init__` ```python __init__(computation: Node, input_tracers: List[ForwardRef('Tracer')]) ``` --- #### property T Trace numpy.ndarray.T. --- #### property ndim Trace numpy.ndarray.ndim. --- #### property shape Trace numpy.ndarray.shape. --- #### property size Trace numpy.ndarray.size. --- ### method `astype` ```python astype( dtype: Union[dtype[Any], NoneType, type[Any], _SupportsDType[dtype[Any]], str, tuple[Any, int], tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], list[Any], _DTypeDict, tuple[Any, Any], Type[ForwardRef('ScalarAnnotation')]] ) → Tracer ``` Trace numpy.ndarray.astype(dtype). --- ### method `clip` ```python clip(minimum: Any, maximum: Any) → Tracer ``` Trace numpy.ndarray.clip(). --- ### method `dot` ```python dot(other: Any) → Tracer ``` Trace numpy.ndarray.dot(). --- ### method `flatten` ```python flatten() → Tracer ``` Trace numpy.ndarray.flatten(). --- ### method `reshape` ```python reshape(*newshape: Union[Any, Tuple[Any, ]]) → Tracer ``` Trace numpy.ndarray.reshape(newshape). --- ### method `round` ```python round(decimals: int = 0) → Tracer ``` Trace numpy.ndarray.round(). --- ### method `sanitize` ```python sanitize(value: Any) → Any ``` Try to create a tracer from a value. **Args:** value (Any): value to use **Returns:** Any: resulting tracer --- ### method `trace` ```python trace( function: Callable, parameters: Dict[str, ValueDescription], is_direct: bool = False ) → Graph ``` Trace `function` and create the `Graph` that represents it. **Args:** function (Callable): function to trace parameters (Dict[str, ValueDescription]): parameters of function to trace e.g. parameter x is an EncryptedScalar holding a 7-bit UnsignedInteger is_direct (bool, default = False): whether the tracing is done on actual parameters or placeholders **Returns:** Graph: computation graph corresponding to `function` --- ### method `transpose` ```python transpose(axes: Optional[Tuple[int, ]] = None) → Tracer ``` Trace numpy.ndarray.transpose(). --- ## class `Annotation` Base annotation for direct definition. ### method `__init__` ```python __init__(computation: Node, input_tracers: List[ForwardRef('Tracer')]) ``` --- #### property T Trace numpy.ndarray.T. --- #### property ndim Trace numpy.ndarray.ndim. --- #### property shape Trace numpy.ndarray.shape. --- #### property size Trace numpy.ndarray.size. --- ### method `astype` ```python astype( dtype: Union[dtype[Any], NoneType, type[Any], _SupportsDType[dtype[Any]], str, tuple[Any, int], tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], list[Any], _DTypeDict, tuple[Any, Any], Type[ForwardRef('ScalarAnnotation')]] ) → Tracer ``` Trace numpy.ndarray.astype(dtype). --- ### method `clip` ```python clip(minimum: Any, maximum: Any) → Tracer ``` Trace numpy.ndarray.clip(). --- ### method `dot` ```python dot(other: Any) → Tracer ``` Trace numpy.ndarray.dot(). --- ### method `flatten` ```python flatten() → Tracer ``` Trace numpy.ndarray.flatten(). --- ### method `reshape` ```python reshape(*newshape: Union[Any, Tuple[Any, ]]) → Tracer ``` Trace numpy.ndarray.reshape(newshape). --- ### method `round` ```python round(decimals: int = 0) → Tracer ``` Trace numpy.ndarray.round(). --- ### method `sanitize` ```python sanitize(value: Any) → Any ``` Try to create a tracer from a value. **Args:** value (Any): value to use **Returns:** Any: resulting tracer --- ### method `trace` ```python trace( function: Callable, parameters: Dict[str, ValueDescription], is_direct: bool = False ) → Graph ``` Trace `function` and create the `Graph` that represents it. **Args:** function (Callable): function to trace parameters (Dict[str, ValueDescription]): parameters of function to trace e.g. parameter x is an EncryptedScalar holding a 7-bit UnsignedInteger is_direct (bool, default = False): whether the tracing is done on actual parameters or placeholders **Returns:** Graph: computation graph corresponding to `function` --- ### method `transpose` ```python transpose(axes: Optional[Tuple[int, ]] = None) → Tracer ``` Trace numpy.ndarray.transpose(). --- ## class `ScalarAnnotation` Base scalar annotation for direct definition. ### method `__init__` ```python __init__(computation: Node, input_tracers: List[ForwardRef('Tracer')]) ``` --- #### property T Trace numpy.ndarray.T. --- #### property ndim Trace numpy.ndarray.ndim. --- #### property shape Trace numpy.ndarray.shape. --- #### property size Trace numpy.ndarray.size. --- ### method `astype` ```python astype( dtype: Union[dtype[Any], NoneType, type[Any], _SupportsDType[dtype[Any]], str, tuple[Any, int], tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], list[Any], _DTypeDict, tuple[Any, Any], Type[ForwardRef('ScalarAnnotation')]] ) → Tracer ``` Trace numpy.ndarray.astype(dtype). --- ### method `clip` ```python clip(minimum: Any, maximum: Any) → Tracer ``` Trace numpy.ndarray.clip(). --- ### method `dot` ```python dot(other: Any) → Tracer ``` Trace numpy.ndarray.dot(). --- ### method `flatten` ```python flatten() → Tracer ``` Trace numpy.ndarray.flatten(). --- ### method `reshape` ```python reshape(*newshape: Union[Any, Tuple[Any, ]]) → Tracer ``` Trace numpy.ndarray.reshape(newshape). --- ### method `round` ```python round(decimals: int = 0) → Tracer ``` Trace numpy.ndarray.round(). --- ### method `sanitize` ```python sanitize(value: Any) → Any ``` Try to create a tracer from a value. **Args:** value (Any): value to use **Returns:** Any: resulting tracer --- ### method `trace` ```python trace( function: Callable, parameters: Dict[str, ValueDescription], is_direct: bool = False ) → Graph ``` Trace `function` and create the `Graph` that represents it. **Args:** function (Callable): function to trace parameters (Dict[str, ValueDescription]): parameters of function to trace e.g. parameter x is an EncryptedScalar holding a 7-bit UnsignedInteger is_direct (bool, default = False): whether the tracing is done on actual parameters or placeholders **Returns:** Graph: computation graph corresponding to `function` --- ### method `transpose` ```python transpose(axes: Optional[Tuple[int, ]] = None) → Tracer ``` Trace numpy.ndarray.transpose(). --- ## class `TensorAnnotation` Base tensor annotation for direct definition. ### method `__init__` ```python __init__(computation: Node, input_tracers: List[ForwardRef('Tracer')]) ``` --- #### property T Trace numpy.ndarray.T. --- #### property ndim Trace numpy.ndarray.ndim. --- #### property shape Trace numpy.ndarray.shape. --- #### property size Trace numpy.ndarray.size. --- ### method `astype` ```python astype( dtype: Union[dtype[Any], NoneType, type[Any], _SupportsDType[dtype[Any]], str, tuple[Any, int], tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], list[Any], _DTypeDict, tuple[Any, Any], Type[ForwardRef('ScalarAnnotation')]] ) → Tracer ``` Trace numpy.ndarray.astype(dtype). --- ### method `clip` ```python clip(minimum: Any, maximum: Any) → Tracer ``` Trace numpy.ndarray.clip(). --- ### method `dot` ```python dot(other: Any) → Tracer ``` Trace numpy.ndarray.dot(). --- ### method `flatten` ```python flatten() → Tracer ``` Trace numpy.ndarray.flatten(). --- ### method `reshape` ```python reshape(*newshape: Union[Any, Tuple[Any, ]]) → Tracer ``` Trace numpy.ndarray.reshape(newshape). --- ### method `round` ```python round(decimals: int = 0) → Tracer ``` Trace numpy.ndarray.round(). --- ### method `sanitize` ```python sanitize(value: Any) → Any ``` Try to create a tracer from a value. **Args:** value (Any): value to use **Returns:** Any: resulting tracer --- ### method `trace` ```python trace( function: Callable, parameters: Dict[str, ValueDescription], is_direct: bool = False ) → Graph ``` Trace `function` and create the `Graph` that represents it. **Args:** function (Callable): function to trace parameters (Dict[str, ValueDescription]): parameters of function to trace e.g. parameter x is an EncryptedScalar holding a 7-bit UnsignedInteger is_direct (bool, default = False): whether the tracing is done on actual parameters or placeholders **Returns:** Graph: computation graph corresponding to `function` --- ### method `transpose` ```python transpose(axes: Optional[Tuple[int, ]] = None) → Tracer ``` Trace numpy.ndarray.transpose().