torch_tensor_array_delete Subroutine

public subroutine torch_tensor_array_delete(tensor_array)

Deallocates an array of tensors.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(inout), dimension(:) :: tensor_array

Source Code

  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