torch_tensor_power_int8 Function

public function torch_tensor_power_int8(tensor, power) result(output)

Overloads exponentiation operator for a tensor and a scalar of type int8

Arguments

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

Return Value type(torch_tensor)


Source Code

  function torch_tensor_power_int8(tensor, power) result(output)
    type(torch_tensor), intent(in) :: tensor
    integer(kind=int8), intent(in) :: power
    type(torch_tensor) :: output

    interface
      function torch_tensor_power_c(tensor_c, power_c) result(output_c)        &
          bind(c, name = 'torch_tensor_power')
        use, intrinsic :: iso_c_binding, only : c_ptr
        use, intrinsic :: iso_fortran_env, only : int8
        implicit none
        type(c_ptr), value, intent(in) :: tensor_c
        integer(kind=int8), value, intent(in) :: power_c
        type(c_ptr) :: output_c
      end function torch_tensor_power_c
    end interface

    output%p = torch_tensor_power_c(tensor%p, power)
  end function torch_tensor_power_int8