Class ModelProto
Models
ModelProto is a top-level file/container format for bundling a ML model and
associating its computation graph with metadata.
The semantics of the model are described by the associated GraphProto.
Namespace: Onnx
Syntax
public sealed class ModelProto : Google.Protobuf.IMessage<ModelProto>
Constructors
ModelProto()
Declaration
ModelProto(ModelProto)
Declaration
public ModelProto(ModelProto other)
Parameters
Fields
DocStringFieldNumber
Field number for the "doc_string" field.
Declaration
public const int DocStringFieldNumber = 6
Field Value
DomainFieldNumber
Field number for the "domain" field.
Declaration
public const int DomainFieldNumber = 4
Field Value
GraphFieldNumber
Field number for the "graph" field.
Declaration
public const int GraphFieldNumber = 7
Field Value
IrVersionFieldNumber
Field number for the "ir_version" field.
Declaration
public const int IrVersionFieldNumber = 1
Field Value
Field number for the "metadata_props" field.
Declaration
public const int MetadataPropsFieldNumber = 14
Field Value
ModelVersionFieldNumber
Field number for the "model_version" field.
Declaration
public const int ModelVersionFieldNumber = 5
Field Value
OpsetImportFieldNumber
Field number for the "opset_import" field.
Declaration
public const int OpsetImportFieldNumber = 8
Field Value
ProducerNameFieldNumber
Field number for the "producer_name" field.
Declaration
public const int ProducerNameFieldNumber = 2
Field Value
ProducerVersionFieldNumber
Field number for the "producer_version" field.
Declaration
public const int ProducerVersionFieldNumber = 3
Field Value
Properties
Descriptor
Declaration
public static Google.Protobuf.Reflection.MessageDescriptor Descriptor { get; }
Property Value
Type |
Description |
Google.Protobuf.Reflection.MessageDescriptor |
|
DocString
A human-readable documentation for this model. Markdown is allowed.
Declaration
public string DocString { get; set; }
Property Value
Domain
Domain name of the model.
We use reverse domain names as name space indicators. For example:
com.facebook.fair
or com.microsoft.cognitiveservices
Together with model_version
and GraphProto.name, this forms the unique identity of
the graph.
Declaration
public string Domain { get; set; }
Property Value
Graph
The parameterized graph that is evaluated to execute the model.
Declaration
public GraphProto Graph { get; set; }
Property Value
IrVersion
The version of the IR this model targets. See Version enum above.
This field MUST be present.
Declaration
public long IrVersion { get; set; }
Property Value
Named metadata values; keys should be distinct.
Declaration
public Google.Protobuf.Collections.RepeatedField<StringStringEntryProto> MetadataProps { get; }
Property Value
ModelVersion
The version of the graph encoded. See Version enum below.
Declaration
public long ModelVersion { get; set; }
Property Value
OpsetImport
The OperatorSets this model relies on.
All ModelProtos MUST have at least one entry that
specifies which version of the ONNX OperatorSet is
being imported.
All nodes in the ModelProto's graph will bind against the operator
with the same-domain/same-op_type operator with the HIGHEST version
in the referenced operator sets.
Declaration
public Google.Protobuf.Collections.RepeatedField<OperatorSetIdProto> OpsetImport { get; }
Property Value
Parser
Declaration
public static Google.Protobuf.MessageParser<ModelProto> Parser { get; }
Property Value
Type |
Description |
Google.Protobuf.MessageParser<ModelProto> |
|
ProducerName
The name of the framework or tool used to generate this model.
This field SHOULD be present to indicate which implementation/tool/framework
emitted the model.
Declaration
public string ProducerName { get; set; }
Property Value
ProducerVersion
The version of the framework or tool used to generate this model.
This field SHOULD be present to indicate which implementation/tool/framework
emitted the model.
Declaration
public string ProducerVersion { get; set; }
Property Value
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Clone()
Declaration
public ModelProto Clone()
Returns
Equals(ModelProto)
Declaration
public bool Equals(ModelProto other)
Parameters
Returns
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
Object |
other |
|
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Declaration
public void MergeFrom(Google.Protobuf.CodedInputStream input)
Parameters
Type |
Name |
Description |
Google.Protobuf.CodedInputStream |
input |
|
MergeFrom(ModelProto)
Declaration
public void MergeFrom(ModelProto other)
Parameters
ToString()
Declaration
public override string ToString()
Returns
WriteTo(Google.Protobuf.CodedOutputStream)
Declaration
public void WriteTo(Google.Protobuf.CodedOutputStream output)
Parameters
Type |
Name |
Description |
Google.Protobuf.CodedOutputStream |
output |
|