fhelium.backend.rns.tables
RNS quotient tables and depth-indexed rescaling data.
rescale_inverse_matrix
function View source
python
def rescale_inverse_matrix(rns_context: RnsContext) -> torch.Tensor: ...1
moddown_inverse_tables
function View source
python
def moddown_inverse_tables(rns_context: RnsContext) -> tuple[torch.Tensor, ...]: ...1
RescaleTables
class View source
python
RescaleTables(rns_context: RnsContext, dropped_prime_inverses_montgomery: torch.Tensor)1
Own pairwise and prefix-product inverses used by RNS rescaling.
Attributes
| Name | Type | Default/value |
|---|---|---|
rns_context | RnsContext | |
dropped_prime_inverses_montgomery | torch.Tensor |
device
property
python
device: torch.device1
active_views
method
python
def active_views(row_count: int, *, include_p: bool) -> tuple[torch.Tensor, torch.Tensor, int]: ...1
Return preselected parameters, inverses, and dropped modulus.
prefix_inverse
method
python
def prefix_inverse(row_count: int, drop_count: int, *, include_p: bool) -> torch.Tensor: ...1
Return
drop_count active primes. The resource retains the vector for reuse with the same prime interval.
tensor_operands
method
python
def tensor_operands(row_count: int, drop_count: int, *, include_p: bool, ntt_context: NttContext | None=None) -> tuple[dict[str, torch.Tensor], dict[str, object]]: ...1
Expose quotient tables and scalar rounding offsets for one group.