Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.get_default_dtype function

PyTorch torch.get_default_dtype function


PyTorch torch reference manual 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

(

)

print

(

"Default dtype:"

,

dtype

)

The output is:

默认 dtype: torch.float32


PyTorch torch reference manual PyTorch torch reference manual