xnn.common.models.constants.ExactFloat64Constants#
- class xnn.common.models.constants.ExactFloat64Constants(*args, **kwargs)[source]#
Bases:
objectMixin for a model whose float64 constants stay exact through casts and loads.
List it before the
torch.nn.Modulebase class. After every cast (.to,.double, …) and everyload_state_dictof the model, or of a module that contains it,exact_float64_constants()rebuilds its float64 constants exactly.