torch_tensor_premultiply_int64 Function

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

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

Arguments

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

Return Value type(torch_tensor)


Source Code

  function torch_tensor_premultiply_int64(scalar, tensor) result(output)
    integer(kind=int64), 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 : int64
        implicit none
        integer(kind=int64), 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_int64