Determines the rank of a tensor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(in) | :: | self |
rank of tensor
function get_rank(self) result(rank) class(torch_tensor), intent(in) :: self integer(kind=int32) :: rank !! rank of tensor interface function torch_tensor_get_rank_c(tensor) result(rank) & bind(c, name = 'torch_tensor_get_rank') use, intrinsic :: iso_c_binding, only : c_int, c_ptr type(c_ptr), value, intent(in) :: tensor integer(c_int) :: rank end function torch_tensor_get_rank_c end interface rank = torch_tensor_get_rank_c(self%p) end function get_rank