Dynamic dispatch functor based on ObjectPath.
More...
#include <ir_docsifier_functor.h>
template<typename R, typename... Args>
class tvm::script::printer::IRDocsifierFunctor< R, Args >
Dynamic dispatch functor based on ObjectPath.
This functor dispatches based on the type of object and the input dispatch token.
◆ operator()()
template<typename R , typename... Args>
template<class TObjectRef >
Call the dispatch function.
- Parameters
-
token | The dispatch token. |
obj | The object. |
args | Other args. |
- Returns
- The return value of the dispatch function
If the TObjectRef isn't registered with the token, it will try to find dispatch function for TObjectRef with the default dispatch token (empty string).
◆ remove_dispatch()
template<typename R , typename... Args>
Remove dispatch function.
- Parameters
-
token | The dispatch token. |
type_index | The TVM object type index for the dispatch function to be removed. |
This is useful when dispatch function comes from other language's runtime, and those function should be removed before that language runtime shuts down.
◆ set_dispatch() [1/2]
template<typename R , typename... Args>
Set the dispatch function.
- Parameters
-
token | The dispatch token. |
type_index | The TVM object type index for this dispatch function. |
f | The dispatch function. |
This takes a type-erased packed function as input. It should be used through FFI boundary, for example, registering dispatch function from Python.
◆ set_dispatch() [2/2]
template<typename R , typename... Args>
template<typename TObjectRef , typename TCallable , typename = std::enable_if_t<IsDispatchFunction<TObjectRef, TCallable>::value>>
Set the dispatch function.
- Parameters
-
token | The dispatch token. |
f | The dispatch function. |
The documentation for this class was generated from the following file: