tvm
Static Public Member Functions | List of all members
tvm::runtime::ObjectTypeChecker< T > Struct Template Reference

Type traits for runtime type check during FFI conversion. More...

#include <packed_func.h>

Collaboration diagram for tvm::runtime::ObjectTypeChecker< T >:

Static Public Member Functions

static Optional< StringCheckAndGetMismatch (const Object *ptr)
 Check if an object matches the template type and return the mismatched type if it exists. More...
 
static bool Check (const Object *ptr)
 Check if an object matches the template type. More...
 
static std::string TypeName ()
 

Detailed Description

template<typename T>
struct tvm::runtime::ObjectTypeChecker< T >

Type traits for runtime type check during FFI conversion.

Template Parameters
Tthe type to be checked.

Member Function Documentation

◆ Check()

template<typename T >
static bool tvm::runtime::ObjectTypeChecker< T >::Check ( const Object ptr)
inlinestatic

Check if an object matches the template type.

Parameters
ptrThe object to check the type of.
Returns
Whether or not the template type matches the objects type.

◆ CheckAndGetMismatch()

template<typename T >
static Optional<String> tvm::runtime::ObjectTypeChecker< T >::CheckAndGetMismatch ( const Object ptr)
inlinestatic

Check if an object matches the template type and return the mismatched type if it exists.

Parameters
ptrThe object to check the type of.
Returns
An Optional containing the actual type of the pointer if it does not match the template type. If the Optional does not contain a value, then the types match.

◆ TypeName()

template<typename T >
static std::string tvm::runtime::ObjectTypeChecker< T >::TypeName ( )
inlinestatic

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