TensorProto

Models & Types · AiDotNet.Onnx.Protobuf

Tensors

A serialized tensor value.

Implements: IBufferMessage, IMessage<TensorProto>

Constructors

Constructor Summary
TensorProto()
TensorProto(TensorProto other)

Properties

Property Summary
ByteString RawData { get; set; } Serializations can either use one of the fields above, or use this raw bytes field.
DataLocation DataLocation { get; set; } If value not set, data is stored in raw_data (if set) otherwise in type-specified field.
MessageDescriptor Descriptor { get; }
MessageParser<TensorProto> Parser { get; }
RepeatedField<ByteString> StringData { get; } For strings.
RepeatedField<StringStringEntryProto> ExternalData { get; } Data can be stored inside the protobuf file using type-specific fields or raw_data.
RepeatedField<StringStringEntryProto> MetadataProps { get; } Named metadata values; keys should be distinct.
RepeatedField<double> DoubleData { get; } For double Complex128 tensors are encoded as a single array of doubles, with the real components appearing in odd numbered positions, and the corresponding imaginary component appearing in the subsequent even numbered position.
RepeatedField<float> FloatData { get; } For float and complex64 values Complex64 tensors are encoded as a single array of floats, with the real components appearing in odd numbered positions, and the corresponding imaginary component appearing in the subsequent even numbered posi…
RepeatedField<int> Int32Data { get; } For int32, uint8, int8, uint16, int16, uint4, int4, bool, float8 and float16 values float16 and float8 values must be bit-wise converted to an uint16_t prior to writing to the buffer.
RepeatedField<long> Dims { get; } The shape of the tensor.
RepeatedField<long> Int64Data { get; } For int64.
RepeatedField<ulong> Uint64Data { get; } For uint64 and uint32 values When this field is present, the data_type field MUST be UINT32 or UINT64
Segment Segment { get; set; }
int DataType { get; set; } The data type of the tensor.
string DocString { get; set; } A human-readable documentation for this tensor.
string Name { get; set; } Optionally, a name for the tensor.

Methods

Method Summary
TensorProto Clone()
bool Equals(TensorProto other)
bool Equals(object other)
int CalculateSize()
int GetHashCode()
string ToString()
void MergeFrom(CodedInputStream input)
void MergeFrom(TensorProto other)
void WriteTo(CodedOutputStream output)

Fields

Field Summary
int DataLocationFieldNumber Field number for the “data_location” field.
int DataTypeFieldNumber Field number for the “data_type” field.
int DimsFieldNumber Field number for the “dims” field.
int DocStringFieldNumber Field number for the “doc_string” field.
int DoubleDataFieldNumber Field number for the “double_data” field.
int ExternalDataFieldNumber Field number for the “external_data” field.
int FloatDataFieldNumber Field number for the “float_data” field.
int Int32DataFieldNumber Field number for the “int32_data” field.
int Int64DataFieldNumber Field number for the “int64_data” field.
int MetadataPropsFieldNumber Field number for the “metadata_props” field.
int NameFieldNumber Field number for the “name” field.
int RawDataFieldNumber Field number for the “raw_data” field.
int SegmentFieldNumber Field number for the “segment” field.
int StringDataFieldNumber Field number for the “string_data” field.
int Uint64DataFieldNumber Field number for the “uint64_data” field.