cast_model_to_bf16

paddle.fluid.contrib.mixed_precision.bf16.amp_utils. cast_model_to_bf16 ( program, startup_prog=None, amp_lists=None, use_bf16_guard=True ) [source]

Traverse all ops in the whole model and set their inputs and outputs to the bf16 data type. This function will do some special processing for the batch normalization, which will keep the batchnorm’s computations in FP32. :param program: The used program. :type program: Program :param amp_lists: An AutoMixedPrecisionListsBF16 object. :type amp_lists: AutoMixedPrecisionListsBF16 :param use_bf16_guard: Determine whether to use bf16_guard when

System Message: ERROR/3 (/usr/local/lib/python3.8/site-packages/paddle/fluid/contrib/mixed_precision/bf16/amp_utils.py:docstring of paddle.fluid.contrib.mixed_precision.bf16.amp_utils.cast_model_to_bf16, line 9)

Unexpected indentation.

constructing the program. Default True.

System Message: WARNING/2 (/usr/local/lib/python3.8/site-packages/paddle/fluid/contrib/mixed_precision/bf16/amp_utils.py:docstring of paddle.fluid.contrib.mixed_precision.bf16.amp_utils.cast_model_to_bf16, line 10)

Block quote ends without a blank line; unexpected unindent.