Declaration of ValueDescription
class.
ValueDescription class, to combine data type, shape, and encryption status into a single object.
__init__(dtype: BaseDataType, shape: Tuple[int, ], is_encrypted: bool)
Get whether the value is clear or not.
Returns: bool: True if value is not encrypted, False otherwise
Get whether the value is scalar or not.
Returns: bool: True if shape of the value is (), False otherwise
Get number of dimensions of the value.
Returns: int: number of dimensions of the value
Get number of elements in the value.
Returns: int: number of elements in the value
of(value: Any, is_encrypted: bool = False) → ValueDescription
Get the ValueDescription
that can represent value
.
Args: value (Any): value that needs to be represented
is_encrypted (bool, default = False): whether the resulting ValueDescription
is encrypted or not
Returns:
ValueDescription: ValueDescription
that can represent value
Raises:
ValueError: if value
cannot be represented by ValueDescription