Determines whether a tensor requires the autograd module.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(torch_tensor), | intent(in) | :: | self |
function torch_tensor_requires_grad(self) result(requires_grad) class(torch_tensor), intent(in) :: self logical :: requires_grad interface function torch_tensor_requires_grad_c(tensor) result(requires_grad) & bind(c, name = 'torch_tensor_requires_grad') use, intrinsic :: iso_c_binding, only : c_bool, c_ptr implicit none type(c_ptr), value, intent(in) :: tensor logical(c_bool) :: requires_grad end function torch_tensor_requires_grad_c end interface requires_grad = torch_tensor_requires_grad_c(self%p) end function torch_tensor_requires_grad