Interface ONNXOperator

All Known Implementing Classes:
ONNXOperators

public interface ONNXOperator
An interface for ONNX operators. Usually implemented by an enum representing the opset.
  • Method Details

    • getOpName

      String getOpName()
      The operator name.
      Returns:
      The name.
    • 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

      Set<String> getMandatoryAttributeNames()
      The mandatory attribute names.
      Returns:
      The required attribute names.
    • getOpVersion

      int getOpVersion()
      Returns the opset version.
      Returns:
      The opset version.
    • getOpDomain

      String getOpDomain()
      Returns the opset domain.

      May be null if 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

      default ai.onnx.proto.OnnxMl.NodeProto build(ONNXContext context, String input, String output)
      Builds this node based on the supplied inputs and output. Throws IllegalArgumentException if 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. Throws IllegalArgumentException if this operator takes more than a single input or output. May throw UnsupportedOperationException if 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

      default ai.onnx.proto.OnnxMl.NodeProto build(ONNXContext context, String[] inputs, String output)
      Builds this node based on the supplied inputs and output. Throws IllegalArgumentException if 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. Throws IllegalArgumentException if the number of inputs, outputs or attributes is wrong. May throw UnsupportedOperationException if 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

      default ai.onnx.proto.OnnxMl.NodeProto build(ONNXContext context, String input, String[] outputs)
      Builds this node based on the supplied input and outputs. Throws IllegalArgumentException if 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. Throws IllegalArgumentException if the number of inputs, outputs or attributes is wrong. May throw UnsupportedOperationException if 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. Throws IllegalArgumentException if 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. Throws IllegalArgumentException if the number of inputs, outputs or attributes is wrong. May throw UnsupportedOperationException if 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.