Files
concrete/docs/dev/api/concrete.fhe.representation.node.md
2024-10-07 08:45:33 +02:00

4.8 KiB

module concrete.fhe.representation.node

Declaration of Node class.

Global Variables

  • KWARGS_IGNORED_IN_FORMATTING
  • NODES_THAT_HAVE_TLU_WHEN_ALL_INPUTS_ARE_ENCRYPTED

class Node

Node class, to represent computation in a computation graph.

method __init__

__init__(
    inputs: List[ValueDescription],
    output: ValueDescription,
    operation: Operation,
    evaluator: Callable,
    properties: Optional[Dict[str, Any]] = None
)

property conversion_have_table_lookup

Get whether the node will have table lookups during execution.

Returns: bool: True if the node will have table lookups during execution, False otherwise


property converted_to_table_lookup

Get whether the node is converted to a table lookup during MLIR conversion.

Returns: bool: True if the node is converted to a table lookup, False otherwise


property is_fusable

Get whether the node is can be fused into a table lookup.

Returns: bool: True if the node can be fused into a table lookup, False otherwise


method constant

constant(constant: Any)  Node

Create an Operation.Constant node.

Args: constant (Any): constant to represent

Returns: Node: node representing constant

Raises: ValueError: if the constant is not representable


method format

format(predecessors: List[str], maximum_constant_length: int = 45)  str

Get the textual representation of the Node (dependent to preds).

Args: predecessors (List[str]): predecessor names to this node

maximum_constant_length (int, default = 45): maximum length of formatted constants

Returns: str: textual representation of the Node (dependent to preds)


method generic

generic(
    name: str,
    inputs: List[ValueDescription],
    output: ValueDescription,
    operation: Callable,
    args: Optional[Tuple[Any, ]] = None,
    kwargs: Optional[Dict[str, Any]] = None,
    attributes: Optional[Dict[str, Any]] = None
)

Create an Operation.Generic node.

Args: name (str): name of the operation

inputs (List[ValueDescription]): inputs to the operation

output (ValueDescription): output of the operation

operation (Callable): operation itself

args (Optional[Tuple[Any, ...]]): args to pass to operation during evaluation

kwargs (Optional[Dict[str, Any]]): kwargs to pass to operation during evaluation

attributes (Optional[Dict[str, Any]]): attributes of the operation

Returns: Node: node representing operation


method input

input(name: str, value: ValueDescription)  Node

Create an Operation.Input node.

Args: name (Any): name of the input

value (Any): value of the input

Returns: Node: node representing input


method label

label()  str

Get the textual representation of the Node (independent of preds).

Returns: str: textual representation of the Node (independent of preds).