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

Array of tensors to deallocate


Calls

proc~~torch_tensor_array_delete~~CallsGraph proc~torch_tensor_array_delete torch_tensor_array_delete proc~torch_tensor_delete torch_tensor_delete proc~torch_tensor_array_delete->proc~torch_tensor_delete

Called by

proc~~torch_tensor_array_delete~~CalledByGraph proc~torch_tensor_array_delete torch_tensor_array_delete interface~torch_delete torch_delete interface~torch_delete->proc~torch_tensor_array_delete

Source Code

  subroutine torch_tensor_array_delete(tensor_array)
    type(torch_tensor), dimension(:), intent(inout) :: tensor_array  !! Array of tensors to deallocate

    ! Local data
    integer(ftorch_int) :: 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