Overloads mean operator over the values in a tensor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(torch_tensor), | intent(inout) | :: | output |
Tensor holding the averaged values |
||
type(torch_tensor), | intent(in) | :: | tensor |
Tensor to average the values of |
subroutine torch_tensor_mean(output, tensor) use, intrinsic :: iso_c_binding, only : c_associated type(torch_tensor), intent(inout) :: output !! Tensor holding the averaged values type(torch_tensor), intent(in) :: tensor !! Tensor to average the values of interface subroutine torch_tensor_mean_c(output_c, tensor_c) & bind(c, name = 'torch_tensor_mean') use, intrinsic :: iso_c_binding, only : c_ptr implicit none type(c_ptr), value, intent(in) :: output_c type(c_ptr), value, intent(in) :: tensor_c end subroutine torch_tensor_mean_c end interface if (.not. c_associated(output%p)) then write(*,*) "Error :: output tensor has not been constructed" stop 1 end if call torch_tensor_mean_c(output%p, tensor%p) end subroutine torch_tensor_mean