Interface ONNXOperator
- All Known Implementing Classes:
ONNXOperators
public interface ONNXOperator
An interface for ONNX operators. Usually implemented by an enum representing the opset.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ai.onnx.proto.OnnxMl.NodeProtobuild(ONNXContext context, String[] inputs, String output) Builds this node based on the supplied inputs and output.default ai.onnx.proto.OnnxMl.NodeProtobuild(ONNXContext context, String[] inputs, String[] outputs) Builds this node based on the supplied inputs and outputs.default ai.onnx.proto.OnnxMl.NodeProtoBuilds this node based on the supplied inputs and outputs.default ai.onnx.proto.OnnxMl.NodeProtoBuilds this node based on the supplied inputs and output.default ai.onnx.proto.OnnxMl.NodeProtobuild(ONNXContext context, String input, String output) Builds this node based on the supplied inputs and output.default ai.onnx.proto.OnnxMl.NodeProtobuild(ONNXContext context, String input, String[] outputs) Builds this node based on the supplied input and outputs.default ai.onnx.proto.OnnxMl.NodeProtoBuilds this node based on the supplied input and outputs.default ai.onnx.proto.OnnxMl.NodeProtoBuilds this node based on the supplied inputs and output.The operator attributes.The mandatory attribute names.intThe number of inputs.intThe number of optional inputs.intThe number of outputs.Returns the opset domain.The operator name.intReturns the opset version.default ai.onnx.proto.OnnxMl.OperatorSetIdProtoReturns the opset proto for these operators.
-
Method Details
-
getOpName
-
getNumInputs
int getNumInputs()The number of inputs.- Returns:
- The number of inputs.
-
getNumOptionalInputs
int getNumOptionalInputs()The number of optional inputs.- Returns:
- The number of optional inputs.
-
getNumOutputs
int getNumOutputs()The number of outputs.- Returns:
- The number of outputs.
-
getAttributes
Map<String, ONNXAttribute> getAttributes()The operator attributes.- Returns:
- The operator attribute map.
-
getMandatoryAttributeNames
-
getOpVersion
int getOpVersion()Returns the opset version.- Returns:
- The opset version.
-
getOpDomain
String getOpDomain()Returns the opset domain.May be
nullif it is the default ONNX domain;- Returns:
- The opset domain.
-
opsetProto
default ai.onnx.proto.OnnxMl.OperatorSetIdProto opsetProto()Returns the opset proto for these operators.- Returns:
- The opset proto.
-
build
Builds this node based on the supplied inputs and output. ThrowsIllegalArgumentExceptionif this operator takes more than a single input or output.- Parameters:
context- The onnx context used to ensure this node has a unique name.input- The name of the input.output- The name of the output.- Returns:
- The NodeProto.
-
build
default ai.onnx.proto.OnnxMl.NodeProto build(ONNXContext context, String input, String output, Map<String, Object> attributeValues) Builds this node based on the supplied inputs and output. ThrowsIllegalArgumentExceptionif this operator takes more than a single input or output. May throwUnsupportedOperationExceptionif the attribute type is not supported.- Parameters:
context- The onnx context used to ensure this node has a unique name.input- The names of the input.output- The name of the output.attributeValues- The attribute names and values.- Returns:
- The NodeProto.
-
build
Builds this node based on the supplied inputs and output. ThrowsIllegalArgumentExceptionif the number of inputs or outputs is wrong.- Parameters:
context- The onnx context used to ensure this node has a unique name.inputs- The names of the inputs.output- The name of the output.- Returns:
- The NodeProto.
-
build
default ai.onnx.proto.OnnxMl.NodeProto build(ONNXContext context, String[] inputs, String output, Map<String, Object> attributeValues) Builds this node based on the supplied inputs and output. ThrowsIllegalArgumentExceptionif the number of inputs, outputs or attributes is wrong. May throwUnsupportedOperationExceptionif the attribute type is not supported.- Parameters:
context- The onnx context used to ensure this node has a unique name.inputs- The names of the inputs.output- The name of the output.attributeValues- The attribute names and values.- Returns:
- The NodeProto.
-
build
Builds this node based on the supplied input and outputs. ThrowsIllegalArgumentExceptionif the number of inputs or outputs is wrong.- Parameters:
context- The onnx context used to ensure this node has a unique name.input- The name of the input.outputs- The names of the outputs.- Returns:
- The NodeProto.
-
build
default ai.onnx.proto.OnnxMl.NodeProto build(ONNXContext context, String input, String[] outputs, Map<String, Object> attributeValues) Builds this node based on the supplied input and outputs. ThrowsIllegalArgumentExceptionif the number of inputs, outputs or attributes is wrong. May throwUnsupportedOperationExceptionif the attribute type is not supported.- Parameters:
context- The onnx context used to ensure this node has a unique name.input- The name of the input.outputs- The names of the outputs.attributeValues- The attribute names and values.- Returns:
- The NodeProto.
-
build
default ai.onnx.proto.OnnxMl.NodeProto build(ONNXContext context, String[] inputs, String[] outputs) Builds this node based on the supplied inputs and outputs. ThrowsIllegalArgumentExceptionif the number of inputs or outputs is wrong.- Parameters:
context- The onnx context used to ensure this node has a unique name.inputs- The names of the inputs.outputs- The names of the outputs.- Returns:
- The NodeProto.
-
build
default ai.onnx.proto.OnnxMl.NodeProto build(ONNXContext context, String[] inputs, String[] outputs, Map<String, Object> attributeValues) Builds this node based on the supplied inputs and outputs. ThrowsIllegalArgumentExceptionif the number of inputs, outputs or attributes is wrong. May throwUnsupportedOperationExceptionif the attribute type is not supported.- Parameters:
context- The onnx context used to ensure this node has a unique name.inputs- The names of the inputs.outputs- The names of the outputs.attributeValues- The attribute names and values.- Returns:
- The NodeProto.
-