TorchLean API

NN.Examples.Quickstart.Precision

A model with precision beyond binary64 #

The scalar is FloatLib's configured binary128 value, with 112 stored fraction bits. Both the input constant and model state are constructed in that type, so no binary64 initializer discards the additional precision. The same typed graph provides the forward value and input derivative.

Call NN.Examples.Quickstart.Precision.run from an application. Its output uses exact rational decoding rather than a native floating-point display conversion. This is CPU software execution; changing the scalar format does not create arbitrary-precision CUDA kernels.

@[reducible, inline]

A user-selected format; the upstream type checks the width and bias requirements.

Instances For

    The model is x ↦ weight*x + bias, with explicit typed state supplied when it runs.

    Instances For

      Execute the model and its input derivative without a native floating-point conversion.

      Instances For