torch_tensor_postmultiply_real64 Function

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

Overloads multiplication operator for a tensor and a scalar of type real64.

Arguments

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

Return Value type(torch_tensor)


Source Code

  function torch_tensor_postmultiply_real64(tensor, scalar) result(output)
    type(torch_tensor), intent(in) :: tensor
    real(kind=real64), intent(in) :: scalar
    type(torch_tensor) :: output

    interface
      function torch_tensor_postmultiply_c(tensor_c, scalar_c)                 &
          result(output_c) bind(c, name = 'torch_tensor_postmultiply')
        use, intrinsic :: iso_c_binding, only : c_ptr
        use, intrinsic :: iso_fortran_env, only : real64
        implicit none
        type(c_ptr), value, intent(in) :: tensor_c
        real(kind=real64), value, intent(in) :: scalar_c
        type(c_ptr) :: output_c
      end function torch_tensor_postmultiply_c
    end interface

    output%p = torch_tensor_postmultiply_c(tensor%p, scalar)
  end function torch_tensor_postmultiply_real64