Custom operators

The Windows Machine Learning custom operator Win32 APIs are located in MLOperatorAuthor.h.

APIs

The following is a list of the custom operator APIs with their syntax and descriptions.

Enumerations

Name Description
MLOperatorAttributeType Specifies the type of an attribute. Each attribute type numerically matches the corresponding ONNX type.
MLOperatorEdgeType Specifies the types of an input or output edge of an operator.
MLOperatorExecutionType Specifies whether a kernel uses the CPU or GPU for computation.
MLOperatorKernelOptions Specifies options used when registering custom operator kernels.
MLOperatorParameterOptions Specifies option flags of input and output edges of operators.
MLOperatorSchemaEdgeTypeFormat Specifies the manner in which types of input and output edges are described.
MLOperatorTensorDataType Specifies the data type of a tensor. Each data type numerically matches the corresponding ONNX type.

Functions

Name Description
MLCreateOperatorRegistry Creates an instance of IMLOperatorRegistry which may be used to register a custom operator kernel and custom operator schema.

Interfaces

Name Description
IMLOperatorAttributes Represents the values of an operator's attributes, as determined by a model using the operator.
IMLOperatorKernel Implemented by custom operator kernels.
IMLOperatorKernelContext Provides information about an operator's usage while kernels are being computed.
IMLOperatorKernelCreationContext Provides information about an operator's usage while kernels are being created.
IMLOperatorKernelFactory Implemented by the author of a custom operator kernel to create instances of that kernel.
IMLOperatorRegistry Represents an instance of a registry for the custom operator kernel and schema.
IMLOperatorShapeInferenceContext Provides information about an operator's usage while shape inferrers are being invoked.
IMLOperatorShapeInferrer Implemented by shape inferrers to infer shapes of an operator's output tensor edges.
IMLOperatorTensor Representation of a tensor used during computation of custom operator kernels.
IMLOperatorTensorShapeDescription Represents the set of input and output tensor shapes of an operator.
IMLOperatorTypeInferenceContext Provides information about an operator's usage while type inferrers are being invoked.
IMLOperatorTypeInferrer Implemented by type inferrers to infer the types of an operator's output edges.

Structures

Name Description
MLOperatorAttribute Specifies the name and properties of an attribute of a custom operator.
MLOperatorAttributeNameValue Specifies the name and value(s) of an attribute of a custom operator.
MLOperatorEdgeDescription Specifies the properties of an input or output edge of an operator.
MLOperatorEdgeTypeConstraint Specifies constraints upon the types of edges supported in custom operator kernels and schema.
MLOperatorKernelDescription Description of a custom operator kernel used to register that schema.
MLOperatorSchemaDescription Description of a custom operator schema used to register that schema.
MLOperatorSchemaEdgeDescription Specifies information about an input or output edge of an operator.
MLOperatorSetId Specifies the identity of an operator set.

Note

Use the following resources for help with Windows ML:

  • To ask or answer technical questions about Windows ML, please use the windows-machine-learning tag on Stack Overflow.
  • To report a bug, please file an issue on our GitHub.