Registration class for new operators. More...
#include <custom_operator.h>
Public Member Functions | |
RegisterOperators (std::vector< Operator > operators) | |
Registers a vector of already created Operator s. | |
template<typename Implementation > | |
RegisterOperators (const std::string &name, Implementation &&implementation) | |
Calls op(...) with the given operator name and implementation. | |
template<typename Implementation > | |
RegisterOperators & | op (const std::string &name, Implementation &&implementation) |
Creates a new operator from a name and implementation function (function pointer or function object/lambda) using torch::jit::createOperator , and then registers the operator. More... | |
Registration class for new operators.
Effectively calls torch::jit::registerOperator
for every supplied operator, but allows doing so in the global scope when a RegisterOperators
object is assigned to a static variable. Also handles registration of user-defined, "custom" operators.
Definition at line 266 of file custom_operator.h.
|
inline |
Creates a new operator from a name and implementation function (function pointer or function object/lambda) using torch::jit::createOperator
, and then registers the operator.
Definition at line 286 of file custom_operator.h.