|
| MLTypeCallDispatcher (int32_t dt_type) noexcept |
|
template<template< typename...> class Fn, typename... Args> |
void | Invoke (Args &&...args) const |
|
template<template< typename...> class Fn, typename LeadingTemplateArgTypeList , typename... Args> |
void | InvokeWithLeadingTemplateArgs (Args &&...args) const |
|
template<class Ret , template< typename...> class Fn, typename... Args> |
Ret | InvokeRet (Args &&...args) const |
|
template<class Ret , template< typename...> class Fn, class UnsupportedPolicy , typename... Args> |
Ret | InvokeRetWithUnsupportedPolicy (Args &&...args) const |
|
template<class Ret , template< typename...> class Fn, typename LeadingTemplateArgTypeList , typename... Args> |
Ret | InvokeRetWithLeadingTemplateArgs (Args &&...args) const |
|
template<class Ret , template< typename...> class Fn, class UnsupportedPolicy , typename LeadingTemplateArgTypeList , typename... Args> |
Ret | InvokeRetWithUnsupportedPolicyAndLeadingTemplateArgs (Args &&...args) const |
|
template<typename... Types>
class onnxruntime::utils::MLTypeCallDispatcher< Types >
This class helps to efficiently dispatch calls to implementation function objects with a tensor element type template argument.
The constructor accepts a value corresponding to a tensor element type. For example, it can be obtained from: input_tensor->GetElementType()
The Invoke member functions will instantiate and invoke the provided function object template, Fn. Fn must be default constructible. Fn must also have a tensor element type template argument. This type template argument will be the type that corresponds to the value given in the constructor. These functions accept and forward arbitrary function arguments. They ensure that Fn is called once with the type specified in the constructor.
- Template Parameters
-
Types | The types supported by the implementation. This should be a set of ONNX tensor element types that are supported by ORT. |
Definition at line 259 of file data_types_internal.h.
template<typename... Types>
template<class Ret , template< typename...> class Fn, typename LeadingTemplateArgTypeList , typename... Args>
Invokes Fn<..., T> with leading template arguments and the specified arguments and returns the result.
- Template Parameters
-
Ret | The return type. Fn should return a type convertible to Ret. |
Fn | The function object template. |
LeadingTemplateArgTypeList | A type list of the leading template arguments. |
Args | The argument types. |
Definition at line 369 of file data_types_internal.h.
template<typename... Types>
template<class Ret , template< typename...> class Fn, class UnsupportedPolicy , typename LeadingTemplateArgTypeList , typename... Args>
Invokes Fn<..., T> with leading template arguments and the specified arguments and returns the result.
- Template Parameters
-
Ret | The return type. Fn should return a type convertible to Ret. |
Fn | The function object template. |
UnsupportedPolicy | The policy used to handle unsupported types. See mltype_dispatcher_internal::UnsupportedTypeDefaultPolicy for an example. |
LeadingTemplateArgTypeList | A type list of the leading template arguments. |
Args | The argument types. |
Definition at line 393 of file data_types_internal.h.
template<typename... Types>
template<template< typename...> class Fn, typename LeadingTemplateArgTypeList , typename... Args>
Invokes Fn<..., T> with leading template arguments and the specified arguments.
- Template Parameters
-
Fn | The function object template. |
LeadingTemplateArgTypeList | A type list of the leading template arguments. |
Args | The argument types. |
Definition at line 307 of file data_types_internal.h.