xnn.gnn.constants.exact_float64_constants#

xnn.gnn.constants.exact_float64_constants(module)[source]#

Make the float64 constants of module exact.

Covers the buffers made with register_constant(), e3nn’s tensor products (their _w3j_<l1>_<l2>_<l3> buffers) and any block with an exact_constants() method (the MACE U basis, Allegro’s block Wigner-3j, fixed Bessel frequencies). A stored value that is not its constant up to rounding (a fitted scale, a custom frequency, a checkpoint’s own coupling basis) is kept. When a value changes, the fast-path kernels cached on the blocks are dropped, since they may have been fitted to it.

Parameters:

module (torch.nn.Module) – The model (or any part of it).

Returns:

The number of tensors whose values changed.

Return type:

int