Files
torus/docs/dev/api/torus.fhe.values.value_description.md
zeekay f968edf75a Rename the Concrete dialect and project identifiers to Torus
The MLIR dialect, its conversion passes (TFHEToConcrete, ConcreteToCAPI,
ConcreteToLLVM), the optimizer component, the compiler binary, the Rust
crate and the program_info parameter file all still carried the upstream
project's name. They now carry this one's.

Two things deliberately keep the word, because in them it is not the name.
mlir::OpTrait CRTP parameters mean "the derived type", so they are spelled
Derived and OpTy — LLVM's other conventional spelling for the same idiom.
concreteShape is a capnp field: renaming it would change the serialized
protocol, and the prose describing it is ordinary English.

This also repairs references the earlier partial rename left dangling:
Security.cpp included concrete/curves.gen.h and the directory is torus/,
torus-cpu.h included concrete-num_complex.h, the Torus dialect CMakeLists
named ConcreteOps.td, and compiler/setup.py asked find_namespace_packages
for a "concrete" package that no longer exists — so it built without the
package it ships.
2026-08-27 13:17:38 -07:00

2.2 KiB

module torus.fhe.values.value_description

Declaration of ValueDescription class.


class ValueDescription

ValueDescription class, to combine data type, shape, and encryption status into a single object.

method __init__

__init__(dtype: BaseDataType, shape: tuple[int, ], is_encrypted: bool)

property is_clear

Get whether the value is clear or not.

Returns: bool: True if value is not encrypted, False otherwise


property is_scalar

Get whether the value is scalar or not.

Returns: bool: True if shape of the value is (), False otherwise


property ndim

Get number of dimensions of the value.

Returns: int: number of dimensions of the value


property size

Get number of elements in the value.

Returns: int: number of elements in the value


method of

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