torch.Tensor — PyTorch 1.10.1 documentation
https://pytorch.org/docs/stable/tensorsTensor.type. Returns the type if dtype is not provided, else casts this object to the specified type. Tensor.type_as. Returns this tensor cast to the type of the given tensor. Tensor.unbind. See torch.unbind() Tensor.unfold. Returns a view of the original tensor which contains all slices of size size from self tensor in the dimension dimension ...
torch.Tensor — PyTorch 1.10.1 documentation
pytorch.org › docs › stableTensor.type. Returns the type if dtype is not provided, else casts this object to the specified type. Tensor.type_as. Returns this tensor cast to the type of the given tensor. Tensor.unbind. See torch.unbind() Tensor.unfold. Returns a view of the original tensor which contains all slices of size size from self tensor in the dimension dimension ...
Tensor Attributes — PyTorch 1.10.1 documentation
pytorch.org › docs › stableWhen the output tensor of an arithmetic operation is specified, we allow casting to its dtype except that: An integral output tensor cannot accept a floating point tensor. A boolean output tensor cannot accept a non-boolean tensor. A non-complex output tensor cannot accept a complex tensor. Casting Examples: