is_bfloat16_supported

paddle.amp. is_bfloat16_supported ( device=None ) [source]

Determine whether the place supports bfloat16 in the auto-mixed-precision training.

Parameters

device (str|None, optional) – Specify the running device. It can be cpu, gpu, xpu, gpu:x and xpu:x, where x is the index of the GPUs or XPUs. if device is None, the device is the current device. Default: None.

Examples

>>> import paddle
>>> paddle.amp.is_bfloat16_supported() # True or False
True