Files
torus/docs/dev/api/torus.fhe.extensions.ones.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

1.9 KiB

module torus.fhe.extensions.ones

Declaration of ones and one functions, to simplify creation of encrypted ones.


function ones

ones(shape: Union[int, tuple[int, ]]) → Union[ndarray, Tracer]

Create an encrypted array of ones.

Args: shape (Tuple[int, ...]): shape of the array

Returns: Union[np.ndarray, Tracer]: Tracer that represents the operation during tracing ndarray filled with ones otherwise


function one

one() → Union[ndarray, Tracer]

Create an encrypted scalar with the value of one.

Returns: Union[np.ndarray, Tracer]: Tracer that represents the operation during tracing ndarray with one otherwise


function ones_like

ones_like(array: Union[ndarray, Tracer]) → Union[ndarray, Tracer]

Create an encrypted array of ones with the same shape as another array.

Args: array (Union[np.ndarray, Tracer]): original array

Returns: Union[np.ndarray, Tracer]: Tracer that represent the operation during tracing ndarray filled with ones otherwise