tvm
Public Member Functions | Static Public Member Functions | List of all members
tvm::runtime::TVMRetValue Class Reference

Return Value container, Unlike TVMArgValue, which only holds reference and do not delete the underlying container during destruction. More...

#include <packed_func.h>

Inheritance diagram for tvm::runtime::TVMRetValue:
Collaboration diagram for tvm::runtime::TVMRetValue:

Public Member Functions

 TVMRetValue ()
 default constructor More...
 
 TVMRetValue (TVMRetValue &&other)
 move constructor from another return value. More...
 
 ~TVMRetValue ()
 destructor More...
 
 TVMRetValue (const TVMRetValue &other)
 
 operator DLDataType () const
 
 operator DataType () const
 
template<typename FType >
 operator TypedPackedFunc< FType > () const
 
TVMRetValueoperator= (TVMRetValue &&other)
 
TVMRetValueoperator= (double value)
 
TVMRetValueoperator= (std::nullptr_t value)
 
TVMRetValueoperator= (void *value)
 
TVMRetValueoperator= (int64_t value)
 
TVMRetValueoperator= (int value)
 
TVMRetValueoperator= (DLDevice value)
 
TVMRetValueoperator= (DLDataType t)
 
TVMRetValueoperator= (const DataType &other)
 
TVMRetValueoperator= (bool value)
 
TVMRetValueoperator= (std::string value)
 
TVMRetValueoperator= (TVMByteArray value)
 
TVMRetValueoperator= (NDArray other)
 
TVMRetValueoperator= (Module m)
 
TVMRetValueoperator= (PackedFunc f)
 
template<typename FType >
TVMRetValueoperator= (const TypedPackedFunc< FType > &f)
 
TVMRetValueoperator= (const TVMRetValue &other)
 
TVMRetValueoperator= (const TVMArgValue &other)
 
TVMRetValueoperator= (TVMMovableArgValue_ &&other)
 
void MoveToCHost (TVMValue *ret_value, int *ret_type_code)
 Move the value back to front-end via C API. This marks the current container as null. The managed resources are moved to the front-end. The front end should take charge in managing them. More...
 
const TVMValuevalue () const
 
template<typename TObjectRef , typename = typename std::enable_if<std::is_base_of<ObjectRef, TObjectRef>::value>::type>
TVMRetValueoperator= (TObjectRef other)
 
template<typename T , typename = typename std::enable_if<std::is_class<T>::value>::type>
 operator T () const
 
template<typename TObjectRef >
TObjectRef AsObjectRef () const
 
template<typename TObjectRef , typename = typename std::enable_if<std::is_base_of<ObjectRef, TObjectRef>::value>::type>
bool IsObjectRef () const
 
- Public Member Functions inherited from tvm::runtime::TVMPODValue_
 operator double () const
 
 operator int64_t () const
 
 operator uint64_t () const
 
 operator int () const
 
 operator bool () const
 
 operator void * () const
 
 operator DLTensor * () const
 
 operator NDArray () const
 
 operator Module () const
 
 operator PackedFunc () const
 
 operator Device () const
 
int type_code () const
 
template<typename T >
T * ptr () const
 return handle as specific pointer type. More...
 
template<typename TObjectRef , typename = typename std::enable_if<std::is_base_of<ObjectRef, TObjectRef>::value>::type>
bool IsObjectRef () const
 
template<typename TObjectRef >
TObjectRef AsObjectRef () const
 

Static Public Member Functions

static TVMRetValue MoveFromCHost (TVMValue value, int type_code)
 Construct a new TVMRetValue by moving from return value stored via C API. More...
 

Additional Inherited Members

- Protected Member Functions inherited from tvm::runtime::TVMPODValue_
 TVMPODValue_ ()
 
 TVMPODValue_ (TVMValue value, int type_code)
 
- Protected Attributes inherited from tvm::runtime::TVMPODValue_
TVMValue value_
 The value. More...
 
int type_code_
 the type code More...
 

Detailed Description

Return Value container, Unlike TVMArgValue, which only holds reference and do not delete the underlying container during destruction.

TVMRetValue holds value and will manage the underlying containers when it stores a complicated data type.

Constructor & Destructor Documentation

◆ TVMRetValue() [1/3]

tvm::runtime::TVMRetValue::TVMRetValue ( )
inline

default constructor

◆ TVMRetValue() [2/3]

tvm::runtime::TVMRetValue::TVMRetValue ( TVMRetValue &&  other)
inline

move constructor from another return value.

Parameters
otherThe other return value.

◆ ~TVMRetValue()

tvm::runtime::TVMRetValue::~TVMRetValue ( )
inline

destructor

◆ TVMRetValue() [3/3]

tvm::runtime::TVMRetValue::TVMRetValue ( const TVMRetValue other)
inline

Member Function Documentation

◆ AsObjectRef()

template<typename TObjectRef >
TObjectRef tvm::runtime::TVMPODValue_::AsObjectRef ( typename TObjectRef  )
inline

◆ IsObjectRef()

template<typename TObjectRef , typename = typename std::enable_if<std::is_base_of<ObjectRef, TObjectRef>::value>::type>
bool tvm::runtime::TVMPODValue_::IsObjectRef ( typename TObjectRef  ,
typename  = typename std::enable_if<std::is_base_of<ObjectRef, TObjectRef>::value>::type 
)
inline

◆ MoveFromCHost()

static TVMRetValue tvm::runtime::TVMRetValue::MoveFromCHost ( TVMValue  value,
int  type_code 
)
inlinestatic

Construct a new TVMRetValue by moving from return value stored via C API.

Parameters
valuethe value.
type_codeThe type code.
Returns
The created TVMRetValue.

◆ MoveToCHost()

void tvm::runtime::TVMRetValue::MoveToCHost ( TVMValue ret_value,
int *  ret_type_code 
)
inline

Move the value back to front-end via C API. This marks the current container as null. The managed resources are moved to the front-end. The front end should take charge in managing them.

Parameters
ret_valueThe return value.
ret_type_codeThe return type code.

◆ operator DataType()

tvm::runtime::TVMRetValue::operator DataType ( ) const
inline

◆ operator DLDataType()

tvm::runtime::TVMRetValue::operator DLDataType ( ) const
inline

◆ operator T()

template<typename T , typename >
tvm::runtime::TVMRetValue::operator T
inline

◆ operator TypedPackedFunc< FType >()

template<typename FType >
tvm::runtime::TVMRetValue::operator TypedPackedFunc< FType > ( ) const
inline

◆ operator=() [1/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( bool  value)
inline

◆ operator=() [2/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( const DataType other)
inline

◆ operator=() [3/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( const TVMArgValue other)
inline

◆ operator=() [4/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( const TVMRetValue other)
inline

◆ operator=() [5/20]

template<typename FType >
TVMRetValue& tvm::runtime::TVMRetValue::operator= ( const TypedPackedFunc< FType > &  f)
inline

◆ operator=() [6/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( DLDataType  t)
inline

◆ operator=() [7/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( DLDevice  value)
inline

◆ operator=() [8/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( double  value)
inline

◆ operator=() [9/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( int  value)
inline

◆ operator=() [10/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( int64_t  value)
inline

◆ operator=() [11/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( Module  m)
inline

◆ operator=() [12/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( NDArray  other)
inline

◆ operator=() [13/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( PackedFunc  f)
inline

◆ operator=() [14/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( std::nullptr_t  value)
inline

◆ operator=() [15/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( std::string  value)
inline

◆ operator=() [16/20]

template<typename TObjectRef , typename >
TVMRetValue & tvm::runtime::TVMRetValue::operator= ( TObjectRef  other)
inline

◆ operator=() [17/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( TVMByteArray  value)
inline

◆ operator=() [18/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( TVMMovableArgValue_ &&  other)
inline

◆ operator=() [19/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( TVMRetValue &&  other)
inline

◆ operator=() [20/20]

TVMRetValue& tvm::runtime::TVMRetValue::operator= ( void *  value)
inline

◆ value()

const TVMValue& tvm::runtime::TVMRetValue::value ( ) const
inline
Returns
The value field, if the data is POD

The documentation for this class was generated from the following file: