Files
concrete/docs/dev/api/concrete.fhe.tfhers.specs.md

3.3 KiB

module concrete.fhe.tfhers.specs

TFHE-rs client specs.


class TFHERSClientSpecs

TFHE-rs client specs.

Contains info about TFHE-rs inputs and outputs.

input_types_per_func (Dict[str, List[Optional[TFHERSIntegerType]]]): maps every input to a type for every function in the module. None means a non-tfhers type output_types_per_func (Dict[str, List[Optional[TFHERSIntegerType]]]): maps every output to a type for every function in the module. None means a non-tfhers type input_shapes_per_func (Dict[str, List[Optional[Tuple[int, ...]]]]): maps every input to a shape for every function in the module. None means a non-tfhers type output_shapes_per_func (Dict[str, List[Optional[Tuple[int, ...]]]]): maps every output to a shape for every function in the module. None means a non-tfhers type

method __init__

__init__(
    input_types_per_func: Dict[str, List[Optional[TFHERSIntegerType]]],
    output_types_per_func: Dict[str, List[Optional[TFHERSIntegerType]]],
    input_shapes_per_func: Dict[str, List[Optional[Tuple[int, ]]]],
    output_shapes_per_func: Dict[str, List[Optional[Tuple[int, ]]]]
)

method from_dict

from_dict(dict_obj: Dict[str, Any])  TFHERSClientSpecs

Create a TFHERSClientSpecs instance from a dictionary.

Args:

  • dict_obj (Dict[str, Any]): A dictionary containing the specifications.

Returns:

  • TFHERSClientSpecs: An instance of TFHERSClientSpecs created from the dictionary.

method from_graphs

from_graphs(graphs: Dict[str, Graph])  TFHERSClientSpecs

Create a TFHERSClientSpecs instance from a dictionary of graphs.

Args:

  • graphs (Dict[str, Graph]): graphs to extract the specs from

Returns:

  • TFHERSClientSpecs: An instance of TFHERSClientSpecs containing the input and output types and shapes for each function.

method to_dict

to_dict()  Dict[str, Any]

Convert the TFHERSClientSpecs object to a dictionary representation.

Returns:

  • Dict[str, Any]: dictionary representation