Deallocates an array of tensors.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(torch_tensor), | intent(inout), | dimension(:) | :: | tensor_array |
subroutine torch_tensor_array_delete(tensor_array) type(torch_tensor), dimension(:), intent(inout) :: tensor_array integer :: i ! use bounds rather than (1, N) because it's safer do i = lbound(tensor_array, dim=1), ubound(tensor_array, dim=1) call torch_tensor_delete(tensor_array(i)) end do end subroutine torch_tensor_array_delete