TTEncoder#

class TTEncoder#

Encoder for tile tensors. Can encode and/or encrypt a tensor into a tile tensor and back again.

assert_equals(self: pyhelayers.TTEncoder, c: pyhelayers.CTileTensor, title: str, expected_vals: numpy.ndarray[numpy.float64], eps: float = 1e-06, percent: bool = False) float#
decode_double(self: pyhelayers.TTEncoder, src: pyhelayers.PTileTensor) numpy.ndarray[numpy.float64]#
decrypt(self: pyhelayers.TTEncoder, res: pyhelayers.PTileTensor, src: pyhelayers.CTileTensor) None#

Decrypt.

Parameters:

res (PTileTensor) – Resulting PTileTensor.

Paramy src:

Input CTileTensor.

decrypt_decode_double(self: pyhelayers.TTEncoder, src: pyhelayers.CTileTensor) numpy.ndarray[numpy.float64]#
encode(self: pyhelayers.TTEncoder, shape: pyhelayers.TTShape, vals: numpy.ndarray[numpy.float64], chain_index: int = -1) pyhelayers.PTileTensor#
encode_encrypt(self: pyhelayers.TTEncoder, shape: pyhelayers.TTShape, vals: numpy.ndarray[numpy.float64], chain_index: int = -1) pyhelayers.CTileTensor#
encode_encrypt_generic_packing(self: pyhelayers.TTEncoder, vals: numpy.ndarray[numpy.float64], generic_packing_config: pyhelayers.GenericPackingConfig = <pyhelayers.GenericPackingConfig object at 0x7f6023140f30>) pyhelayers.CTileTensor#
encrypt(self: pyhelayers.TTEncoder, res: pyhelayers.CTileTensor, src: pyhelayers.PTileTensor) None#

Encrypt.

Parameters:

res (CTileTensor) – Resulting CTileTensor.

Paramy src:

Input PTileTensor.

get_encoder(self: pyhelayers.TTEncoder) pyhelayers.Encoder#

Returns a reference to the basic encoder used by the TTEncoder.

Return type:

bool