fhelium.ir.dialects.semantic
Provider-neutral tensor semantics for encrypted and public values.
AddOp
class View source
AddOp()Bases: _BinarySemanticOp
Add two semantic values pointwise.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_semantic.add' |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
FHEliumSemantic
data View source
FHEliumSemantic = Dialect('fhelium_semantic', [AddOp, SubtractOp, MultiplyOp, NegateOp, RollOp], [SecretType, PublicType])MultiplyOp
class View source
MultiplyOp()Bases: _BinarySemanticOp
Multiply two semantic values pointwise.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_semantic.multiply' |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
NegateOp
class View source
NegateOp()Bases: _UnarySemanticOp
Negate one semantic value pointwise.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_semantic.negate' |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
OPERATION_SPECS
constant View source
OPERATION_SPECS: tuple[OperationSpec, ...] = tuple((registered_operation_spec(operation_type, 'pointwise', validator=flat_without_attributes) for operation_type in (AddOp, SubtractOp, MultiplyOp, NegateOp))) + (registered_operation_spec(RollOp, 'pointwise', validator=_roll_specification),)PublicType
class View source
PublicType()Bases: OpenStateType
Public semantic tensor before encoding or specialization.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_semantic.public' | |
ROLE | ClassVar[ValueRole] | 'message' |
RollOp
class View source
RollOp()Bases: _UnarySemanticOp
Roll one semantic tensor along a statically identified dimension.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_semantic.roll' | |
shift | opt_attr_def(IntegerAttr) | |
dimension | opt_attr_def(IntegerAttr) |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
SecretType
class View source
SecretType()Bases: OpenStateType
Secret semantic tensor before selection of an encryption scheme state.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_semantic.secret' | |
ROLE | ClassVar[ValueRole] | 'encrypted' |
SubtractOp
class View source
SubtractOp()Bases: _BinarySemanticOp
Subtract the right semantic value pointwise from the left.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_semantic.subtract' |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.