torch_tensor_premultiply_real64 Function

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

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

Arguments

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

Return Value type(torch_tensor)


Source Code

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

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

    output%p = torch_tensor_premultiply_c(scalar, tensor%p)
  end function torch_tensor_premultiply_real64