PyTorch torch.get_default_dtype function
PyTorch torch reference manual
torch.get_default_dtype A function in PyTorch for getting the current default floating-point data type.
Function definition
torch.get_default_dtype()
Usage examples
Example
import
torch
Get the default dtype
dtype
=
torch.
get_default_dtype
(
)
(
"Default dtype:"
,
dtype
)
The output is:
默认 dtype: torch.float32