torch_tensor_postdivide_int64 Function

public function torch_tensor_postdivide_int64(tensor, scalar) result(output)

Overloads division operator for a tensor and a scalar of type int64.

Arguments

Type IntentOptional Attributes Name
type(torch_tensor), intent(in) :: tensor
integer(kind=int64), intent(in) :: scalar

Return Value type(torch_tensor)


Source Code

  function torch_tensor_postdivide_int64(tensor, scalar) result(output)
    type(torch_tensor), intent(in) :: tensor
    integer(kind=int64), intent(in) :: scalar
    type(torch_tensor) :: output

    interface
      function torch_tensor_postdivide_c(tensor_c, scalar_c)                 &
          result(output_c) bind(c, name = 'torch_tensor_postdivide')
        use, intrinsic :: iso_c_binding, only : c_ptr
        use, intrinsic :: iso_fortran_env, only : int64
        implicit none
        type(c_ptr), value, intent(in) :: tensor_c
        integer(kind=int64), value, intent(in) :: scalar_c
        type(c_ptr) :: output_c
      end function torch_tensor_postdivide_c
    end interface

    output%p = torch_tensor_postdivide_c(tensor%p, scalar)
  end function torch_tensor_postdivide_int64