cast_parameters_to_fp16

paddle.fluid.contrib.mixed_precision.fp16_utils. cast_parameters_to_fp16 ( place, program, scope=None, to_fp16_var_names=None ) [source]

Traverse all parameters in the whole model and set them to the FP16 data type. Whereas, this function will keep parameters of batchnorms in FP32. :param place: place is used to restore the FP16 weight tensors. :type place: fluid.CPUPlace|fluid.CUDAPlace :param program: The used program. :type program: Program :param scope: scope is used to get the FP32 weight tensor values.

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

Unexpected indentation.

Default is None.

System Message: WARNING/2 (/usr/local/lib/python3.8/site-packages/paddle/fluid/contrib/mixed_precision/fp16_utils.py:docstring of paddle.fluid.contrib.mixed_precision.fp16_utils.cast_parameters_to_fp16, line 9)

Block quote ends without a blank line; unexpected unindent.

Parameters

to_fp16_var_names (set|list, optional) – The data types of vars in to_fp16_var_names will be set to FP16. Usually, it is the returned value of cast_model_to_fp16 API.