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 |
|
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.