Package onnx

Class Onnx.GraphProto

  • All Implemented Interfaces:
    Serializable, Onnx.GraphProtoOrBuilder, org.nd4j.shade.protobuf.Message, org.nd4j.shade.protobuf.MessageLite, org.nd4j.shade.protobuf.MessageLiteOrBuilder, org.nd4j.shade.protobuf.MessageOrBuilder
    Enclosing class:
    Onnx

    public static final class Onnx.GraphProto
    extends org.nd4j.shade.protobuf.GeneratedMessageV3
    implements Onnx.GraphProtoOrBuilder
     Graphs
     A graph defines the computational logic of a model and is comprised of a parameterized
     list of nodes that form a directed acyclic graph based on their inputs and outputs.
     This is the equivalent of the "network" or "graph" in many deep learning
     frameworks.
     
    Protobuf type onnx.GraphProto
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(org.nd4j.shade.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final org.nd4j.shade.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface org.nd4j.shade.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • getNodeCount

        public int getNodeCount()
         The nodes in the graph, sorted topologically.
         
        repeated .onnx.NodeProto node = 1;
        Specified by:
        getNodeCount in interface Onnx.GraphProtoOrBuilder
      • getNameBytes

        public org.nd4j.shade.protobuf.ByteString getNameBytes()
         The name of the graph.
         
        string name = 2;
        Specified by:
        getNameBytes in interface Onnx.GraphProtoOrBuilder
        Returns:
        The bytes for name.
      • getInitializerList

        public List<Onnx.TensorProto> getInitializerList()
         A list of named tensor values, used to specify constant inputs of the graph.
         Each initializer (both TensorProto as well SparseTensorProto) MUST have a name.
         The name MUST be unique across both initializer and sparse_initializer,
         but the name MAY also appear in the input list.
         
        repeated .onnx.TensorProto initializer = 5;
        Specified by:
        getInitializerList in interface Onnx.GraphProtoOrBuilder
      • getInitializerOrBuilderList

        public List<? extends Onnx.TensorProtoOrBuilder> getInitializerOrBuilderList()
         A list of named tensor values, used to specify constant inputs of the graph.
         Each initializer (both TensorProto as well SparseTensorProto) MUST have a name.
         The name MUST be unique across both initializer and sparse_initializer,
         but the name MAY also appear in the input list.
         
        repeated .onnx.TensorProto initializer = 5;
        Specified by:
        getInitializerOrBuilderList in interface Onnx.GraphProtoOrBuilder
      • getInitializerCount

        public int getInitializerCount()
         A list of named tensor values, used to specify constant inputs of the graph.
         Each initializer (both TensorProto as well SparseTensorProto) MUST have a name.
         The name MUST be unique across both initializer and sparse_initializer,
         but the name MAY also appear in the input list.
         
        repeated .onnx.TensorProto initializer = 5;
        Specified by:
        getInitializerCount in interface Onnx.GraphProtoOrBuilder
      • getInitializer

        public Onnx.TensorProto getInitializer​(int index)
         A list of named tensor values, used to specify constant inputs of the graph.
         Each initializer (both TensorProto as well SparseTensorProto) MUST have a name.
         The name MUST be unique across both initializer and sparse_initializer,
         but the name MAY also appear in the input list.
         
        repeated .onnx.TensorProto initializer = 5;
        Specified by:
        getInitializer in interface Onnx.GraphProtoOrBuilder
      • getInitializerOrBuilder

        public Onnx.TensorProtoOrBuilder getInitializerOrBuilder​(int index)
         A list of named tensor values, used to specify constant inputs of the graph.
         Each initializer (both TensorProto as well SparseTensorProto) MUST have a name.
         The name MUST be unique across both initializer and sparse_initializer,
         but the name MAY also appear in the input list.
         
        repeated .onnx.TensorProto initializer = 5;
        Specified by:
        getInitializerOrBuilder in interface Onnx.GraphProtoOrBuilder
      • getSparseInitializerCount

        public int getSparseInitializerCount()
         Initializers (see above) stored in sparse format.
         
        repeated .onnx.SparseTensorProto sparse_initializer = 15;
        Specified by:
        getSparseInitializerCount in interface Onnx.GraphProtoOrBuilder
      • getDocString

        public String getDocString()
         A human-readable documentation for this graph. Markdown is allowed.
         
        string doc_string = 10;
        Specified by:
        getDocString in interface Onnx.GraphProtoOrBuilder
        Returns:
        The docString.
      • getDocStringBytes

        public org.nd4j.shade.protobuf.ByteString getDocStringBytes()
         A human-readable documentation for this graph. Markdown is allowed.
         
        string doc_string = 10;
        Specified by:
        getDocStringBytes in interface Onnx.GraphProtoOrBuilder
        Returns:
        The bytes for docString.
      • getInputCount

        public int getInputCount()
         The inputs and outputs of the graph.
         
        repeated .onnx.ValueInfoProto input = 11;
        Specified by:
        getInputCount in interface Onnx.GraphProtoOrBuilder
      • getValueInfoList

        public List<Onnx.ValueInfoProto> getValueInfoList()
         Information for the values in the graph. The ValueInfoProto.name's
         must be distinct. It is optional for a value to appear in value_info list.
         
        repeated .onnx.ValueInfoProto value_info = 13;
        Specified by:
        getValueInfoList in interface Onnx.GraphProtoOrBuilder
      • getValueInfoCount

        public int getValueInfoCount()
         Information for the values in the graph. The ValueInfoProto.name's
         must be distinct. It is optional for a value to appear in value_info list.
         
        repeated .onnx.ValueInfoProto value_info = 13;
        Specified by:
        getValueInfoCount in interface Onnx.GraphProtoOrBuilder
      • getValueInfo

        public Onnx.ValueInfoProto getValueInfo​(int index)
         Information for the values in the graph. The ValueInfoProto.name's
         must be distinct. It is optional for a value to appear in value_info list.
         
        repeated .onnx.ValueInfoProto value_info = 13;
        Specified by:
        getValueInfo in interface Onnx.GraphProtoOrBuilder
      • getQuantizationAnnotationList

        public List<Onnx.TensorAnnotation> getQuantizationAnnotationList()
         This field carries information to indicate the mapping among a tensor and its
         quantization parameter tensors. For example:
         For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated,
         which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model.
         
        repeated .onnx.TensorAnnotation quantization_annotation = 14;
        Specified by:
        getQuantizationAnnotationList in interface Onnx.GraphProtoOrBuilder
      • getQuantizationAnnotationOrBuilderList

        public List<? extends Onnx.TensorAnnotationOrBuilder> getQuantizationAnnotationOrBuilderList()
         This field carries information to indicate the mapping among a tensor and its
         quantization parameter tensors. For example:
         For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated,
         which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model.
         
        repeated .onnx.TensorAnnotation quantization_annotation = 14;
        Specified by:
        getQuantizationAnnotationOrBuilderList in interface Onnx.GraphProtoOrBuilder
      • getQuantizationAnnotationCount

        public int getQuantizationAnnotationCount()
         This field carries information to indicate the mapping among a tensor and its
         quantization parameter tensors. For example:
         For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated,
         which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model.
         
        repeated .onnx.TensorAnnotation quantization_annotation = 14;
        Specified by:
        getQuantizationAnnotationCount in interface Onnx.GraphProtoOrBuilder
      • getQuantizationAnnotation

        public Onnx.TensorAnnotation getQuantizationAnnotation​(int index)
         This field carries information to indicate the mapping among a tensor and its
         quantization parameter tensors. For example:
         For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated,
         which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model.
         
        repeated .onnx.TensorAnnotation quantization_annotation = 14;
        Specified by:
        getQuantizationAnnotation in interface Onnx.GraphProtoOrBuilder
      • getQuantizationAnnotationOrBuilder

        public Onnx.TensorAnnotationOrBuilder getQuantizationAnnotationOrBuilder​(int index)
         This field carries information to indicate the mapping among a tensor and its
         quantization parameter tensors. For example:
         For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated,
         which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model.
         
        repeated .onnx.TensorAnnotation quantization_annotation = 14;
        Specified by:
        getQuantizationAnnotationOrBuilder in interface Onnx.GraphProtoOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(org.nd4j.shade.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface org.nd4j.shade.protobuf.MessageLite
        Overrides:
        writeTo in class org.nd4j.shade.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface org.nd4j.shade.protobuf.MessageLite
        Overrides:
        getSerializedSize in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface org.nd4j.shade.protobuf.Message
        Overrides:
        equals in class org.nd4j.shade.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface org.nd4j.shade.protobuf.Message
        Overrides:
        hashCode in class org.nd4j.shade.protobuf.AbstractMessage
      • parseFrom

        public static Onnx.GraphProto parseFrom​(ByteBuffer data)
                                         throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Onnx.GraphProto parseFrom​(ByteBuffer data,
                                                org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Onnx.GraphProto parseFrom​(org.nd4j.shade.protobuf.ByteString data)
                                         throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Onnx.GraphProto parseFrom​(org.nd4j.shade.protobuf.ByteString data,
                                                org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Onnx.GraphProto parseFrom​(byte[] data)
                                         throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Onnx.GraphProto parseFrom​(byte[] data,
                                                org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Onnx.GraphProto parseFrom​(org.nd4j.shade.protobuf.CodedInputStream input,
                                                org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws IOException
        Throws:
        IOException
      • newBuilderForType

        public Onnx.GraphProto.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface org.nd4j.shade.protobuf.Message
        Specified by:
        newBuilderForType in interface org.nd4j.shade.protobuf.MessageLite
      • toBuilder

        public Onnx.GraphProto.Builder toBuilder()
        Specified by:
        toBuilder in interface org.nd4j.shade.protobuf.Message
        Specified by:
        toBuilder in interface org.nd4j.shade.protobuf.MessageLite
      • newBuilderForType

        protected Onnx.GraphProto.Builder newBuilderForType​(org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • parser

        public static org.nd4j.shade.protobuf.Parser<Onnx.GraphProto> parser()
      • getParserForType

        public org.nd4j.shade.protobuf.Parser<Onnx.GraphProto> getParserForType()
        Specified by:
        getParserForType in interface org.nd4j.shade.protobuf.Message
        Specified by:
        getParserForType in interface org.nd4j.shade.protobuf.MessageLite
        Overrides:
        getParserForType in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public Onnx.GraphProto getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageOrBuilder