DoublePrecision

class lightning.fabric.plugins.precision.DoublePrecision

Bases: Precision

Plugin for training with double (torch.float64) precision.

convert_input(data)

Convert model inputs (forward) to the floating point precision type of this plugin.

This is a no-op in the base precision plugin, since we assume the data already has the desired type (default is torch.float32).

Return type:

Any

convert_module(module)

Convert the module parameters to the precision type this plugin handles.

This is optional and depends on the precision limitations during optimization.

Return type:

Module

convert_output(data)

Convert outputs to the floating point precision type expected after model’s forward.

This is a no-op in the base precision plugin, since we assume the data already has the desired type (default is torch.float32).

Return type:

Any

forward_context()

A contextmanager for managing model forward/training_step/evaluation_step/predict_step.

Return type:

AbstractContextManager

module_init_context()

Instantiate module parameters or tensors in the precision type this plugin handles.

This is optional and depends on the precision limitations during optimization.

Return type:

AbstractContextManager

tensor_init_context()

Controls how tensors get created (device, dtype).

Return type:

AbstractContextManager

Was this page helpful?

What went wrong?

↑↓ Navigate↵ Open⌘↵ New tabesc Close