Class AttributeProto
Attributes
A named attribute containing either singular float, integer, string, graph,
and tensor values, or repeated float, integer, string, graph, and tensor values.
An AttributeProto MUST contain the name field, and only one of the
following content fields, effectively enforcing a C/C++ union equivalent.
Inheritance
AttributeProto
Namespace: Onnx
Syntax
public sealed class AttributeProto : Google.Protobuf.IMessage<AttributeProto>
Constructors
AttributeProto()
Declaration
AttributeProto(AttributeProto)
Declaration
public AttributeProto(AttributeProto other)
Parameters
Fields
DocStringFieldNumber
Field number for the "doc_string" field.
Declaration
public const int DocStringFieldNumber = 13
Field Value
FFieldNumber
Field number for the "f" field.
Declaration
public const int FFieldNumber = 2
Field Value
FloatsFieldNumber
Field number for the "floats" field.
Declaration
public const int FloatsFieldNumber = 7
Field Value
GFieldNumber
Field number for the "g" field.
Declaration
public const int GFieldNumber = 6
Field Value
GraphsFieldNumber
Field number for the "graphs" field.
Declaration
public const int GraphsFieldNumber = 11
Field Value
IFieldNumber
Field number for the "i" field.
Declaration
public const int IFieldNumber = 3
Field Value
IntsFieldNumber
Field number for the "ints" field.
Declaration
public const int IntsFieldNumber = 8
Field Value
NameFieldNumber
Field number for the "name" field.
Declaration
public const int NameFieldNumber = 1
Field Value
RefAttrNameFieldNumber
Field number for the "ref_attr_name" field.
Declaration
public const int RefAttrNameFieldNumber = 21
Field Value
SFieldNumber
Field number for the "s" field.
Declaration
public const int SFieldNumber = 4
Field Value
SparseTensorFieldNumber
Field number for the "sparse_tensor" field.
Declaration
public const int SparseTensorFieldNumber = 22
Field Value
SparseTensorsFieldNumber
Field number for the "sparse_tensors" field.
Declaration
public const int SparseTensorsFieldNumber = 23
Field Value
StringsFieldNumber
Field number for the "strings" field.
Declaration
public const int StringsFieldNumber = 9
Field Value
TensorsFieldNumber
Field number for the "tensors" field.
Declaration
public const int TensorsFieldNumber = 10
Field Value
TFieldNumber
Field number for the "t" field.
Declaration
public const int TFieldNumber = 5
Field Value
TypeFieldNumber
Field number for the "type" field.
Declaration
public const int TypeFieldNumber = 20
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 attribute. Markdown is allowed.
Declaration
public string DocString { get; set; }
Property Value
F
Exactly ONE of the following fields must be present for this version of the IR
Declaration
public float F { get; set; }
Property Value
Floats
Declaration
public Google.Protobuf.Collections.RepeatedField<float> Floats { get; }
Property Value
Type |
Description |
Google.Protobuf.Collections.RepeatedField<Single> |
|
G
Declaration
public GraphProto G { get; set; }
Property Value
Graphs
Declaration
public Google.Protobuf.Collections.RepeatedField<GraphProto> Graphs { get; }
Property Value
Type |
Description |
Google.Protobuf.Collections.RepeatedField<GraphProto> |
|
I
Declaration
public long I { get; set; }
Property Value
Ints
Declaration
public Google.Protobuf.Collections.RepeatedField<long> Ints { get; }
Property Value
Type |
Description |
Google.Protobuf.Collections.RepeatedField<Int64> |
|
Name
The name field MUST be present for this version of the IR.
Declaration
public string Name { get; set; }
Property Value
Parser
Declaration
public static Google.Protobuf.MessageParser<AttributeProto> Parser { get; }
Property Value
RefAttrName
if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function.
In this case, this AttributeProto does not contain data, and it's a reference of attribute
in parent scope.
NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph.
Declaration
public string RefAttrName { get; set; }
Property Value
S
Declaration
public Google.Protobuf.ByteString S { get; set; }
Property Value
Type |
Description |
Google.Protobuf.ByteString |
|
SparseTensor
Declaration
public SparseTensorProto SparseTensor { get; set; }
Property Value
SparseTensors
Declaration
public Google.Protobuf.Collections.RepeatedField<SparseTensorProto> SparseTensors { get; }
Property Value
Strings
Declaration
public Google.Protobuf.Collections.RepeatedField<Google.Protobuf.ByteString> Strings { get; }
Property Value
Type |
Description |
Google.Protobuf.Collections.RepeatedField<Google.Protobuf.ByteString> |
|
T
Declaration
public TensorProto T { get; set; }
Property Value
Tensors
Declaration
public Google.Protobuf.Collections.RepeatedField<TensorProto> Tensors { get; }
Property Value
Type |
Description |
Google.Protobuf.Collections.RepeatedField<TensorProto> |
|
Type
The type field MUST be present for this version of the IR.
For 0.0.1 versions of the IR, this field was not defined, and
implementations needed to use has_field hueristics to determine
which value field was in use. For IR_VERSION 0.0.2 or later, this
field MUST be set and match the f|i|s|t|... field in use. This
change was made to accomodate proto3 implementations.
Declaration
public AttributeProto.Types.AttributeType Type { get; set; }
Property Value
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Clone()
Declaration
public AttributeProto Clone()
Returns
Equals(AttributeProto)
Declaration
public bool Equals(AttributeProto 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(AttributeProto)
Declaration
public void MergeFrom(AttributeProto 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 |
|