YouTip LogoYouTip

Pytorch Torch Is_Floating_Point

# PyTorch torch.is_floating_point Function * * Pytorch torch Reference Manual](#) `torch.is_floating_point` is a function in PyTorch used to check if the data type of a tensor is a floating-point type. ### Function Definition torch.is_floating_point(input) * * * ## Usage Example ## Example import torch # Floating point tensor x = torch.tensor([1.0,2.0,3.0]) print("Floating point:", torch.is_floating_point(x)) # Integer tensor y = torch.tensor([1,2,3]) print("Integer:", torch.is_floating_point(y)) The output result is: Floating point: TrueInteger: False * * Pytorch torch Reference Manual](#)
← Pytorch Torch Is_Inference_ModPytorch Torch Is_Conj β†’