Type for holding a Torch tensor.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(c_ptr), | public | :: | p | = | c_null_ptr |
pointer to the tensor in memory |
Deallocates a tensor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(torch_tensor), | intent(inout) | :: | tensor |
Tensor to deallocate |
Determines the device index of a tensor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(in) | :: | self |
Tensor to get the device index of |
Device index of tensor
Returns the device type of a tensor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(in) | :: | self |
Tensor to get the device type of |
Device type of tensor
Returns the data type of a tensor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(in) | :: | self |
Tensor to get the data type of |
Data type of tensor
Determines the rank of a tensor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(in) | :: | self |
Tensor to get the rank of |
Rank of tensor
Determines the shape of a tensor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(in) | :: | self |
Tensor to get the shape of |
Pointer to tensor data
Determines whether a tensor requires the autograd module.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(in) | :: | self |
Tensor to query |
Whether the tensor requires autograd
Fills a tensor with the scalar value 0.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(inout) | :: | tensor |
Tensor whose values are to be zeroed |
Resets a tensor's gradient to zero.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(inout) | :: | tensor |
Tensor to zero the gradient of |
type torch_tensor type(c_ptr) :: p = c_null_ptr !! pointer to the tensor in memory contains procedure :: get_rank => torch_tensor_get_rank procedure :: get_shape => torch_tensor_get_shape procedure :: get_dtype => torch_tensor_get_dtype procedure :: get_device_type => torch_tensor_get_device_type procedure :: get_device_index => torch_tensor_get_device_index procedure :: requires_grad => torch_tensor_requires_grad procedure :: zero => torch_tensor_zero procedure :: zero_grad => torch_tensor_zero_grad final :: torch_tensor_delete end type torch_tensor