mindspore.amp

Loss Scale

mindspore.amp.LossScaler

Loss scaler abstract class when using mixed precision.

mindspore.amp.DynamicLossScaler

Dynamic Loss scale class.

mindspore.amp.StaticLossScaler

Static Loss scale class.

mindspore.amp.LossScaleManager

Loss scale (Magnification factor of gradients when mix precision is used) manager abstract class when using mixed precision.

mindspore.amp.DynamicLossScaleManager

Loss scale(Magnification factor of gradients when mix precision is used) manager with loss scale dynamically adjusted, inherits from mindspore.amp.LossScaleManager.

mindspore.amp.FixedLossScaleManager

Loss scale (Magnification factor of gradients when mix precision is used) manager with a fixed loss scale value, inherits from mindspore.amp.LossScaleManager.

Dtype Autocast

mindspore.amp.auto_mixed_precision

Returns a network processed with auto mixed precision.

mindspore.amp.build_train_network

Build the mixed precision training cell automatically.

mindspore.amp.custom_mixed_precision

When the white_list is provided, primitives and cells in white_list will perform the precision conversion.

mindspore.amp.get_black_list

Provide a copy of internal black list used by auto mixed precision with amp_level set to O2.

mindspore.amp.get_white_list

Provide a copy of internal white list used by auto mixed precision with amp_level set to O1.

Overflow Detection

mindspore.amp.all_finite

Returns a scalar Tensor indicating whether the inputs are finite.