Package org.nd4j.ir
Class TensorNamespace.TensorProto
- java.lang.Object
-
- org.nd4j.shade.protobuf.AbstractMessageLite
-
- org.nd4j.shade.protobuf.AbstractMessage
-
- org.nd4j.shade.protobuf.GeneratedMessageV3
-
- org.nd4j.ir.TensorNamespace.TensorProto
-
- All Implemented Interfaces:
Serializable,TensorNamespace.TensorProtoOrBuilder,org.nd4j.shade.protobuf.Message,org.nd4j.shade.protobuf.MessageLite,org.nd4j.shade.protobuf.MessageLiteOrBuilder,org.nd4j.shade.protobuf.MessageOrBuilder
- Enclosing class:
- TensorNamespace
public static final class TensorNamespace.TensorProto extends org.nd4j.shade.protobuf.GeneratedMessageV3 implements TensorNamespace.TensorProtoOrBuilder
Tensors A serialized tensor value.
Protobuf typeorg.nd4j.ir.TensorProto- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTensorNamespace.TensorProto.BuilderTensors A serialized tensor value.static classTensorNamespace.TensorProto.DataLocationLocation of the data for this tensor.static classTensorNamespace.TensorProto.SegmentFor very large tensors, we may want to store them in chunks, in which case the following fields will specify the segment that is stored in the current TensorProto.static interfaceTensorNamespace.TensorProto.SegmentOrBuilder-
Nested classes/interfaces inherited from class org.nd4j.shade.protobuf.GeneratedMessageV3
org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent, org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessage>, org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessage>, org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable, org.nd4j.shade.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static intBOOL_VAL_FIELD_NUMBERstatic intDATA_LOCATION_FIELD_NUMBERstatic intDATA_TYPE_FIELD_NUMBERstatic intDIMS_FIELD_NUMBERstatic intDOC_STRING_FIELD_NUMBERstatic intDOUBLE_DATA_FIELD_NUMBERstatic intEXTERNAL_DATA_FIELD_NUMBERstatic intFLOAT_DATA_FIELD_NUMBERstatic intHALF_VAL_FIELD_NUMBERstatic intINT32_DATA_FIELD_NUMBERstatic intINT64_DATA_FIELD_NUMBERstatic intNAME_FIELD_NUMBERstatic intRAW_DATA_FIELD_NUMBERstatic intSEGMENT_FIELD_NUMBERstatic intSTRING_DATA_FIELD_NUMBERstatic intUINT64_DATA_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)booleangetBoolVal(int index)boolean valuesintgetBoolValCount()boolean valuesList<Boolean>getBoolValList()boolean valuesTensorNamespace.TensorProto.DataLocationgetDataLocation()If value not set, data is stored in raw_data (if set) otherwise in type-specified field.intgetDataLocationValue()If value not set, data is stored in raw_data (if set) otherwise in type-specified field.intgetDataType()The data type of the tensor.static TensorNamespace.TensorProtogetDefaultInstance()TensorNamespace.TensorProtogetDefaultInstanceForType()static org.nd4j.shade.protobuf.Descriptors.DescriptorgetDescriptor()longgetDims(int index)The shape of the tensor.intgetDimsCount()The shape of the tensor.List<Long>getDimsList()The shape of the tensor.StringgetDocString()A human-readable documentation for this tensor.org.nd4j.shade.protobuf.ByteStringgetDocStringBytes()A human-readable documentation for this tensor.doublegetDoubleData(int index)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.intgetDoubleDataCount()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.List<Double>getDoubleDataList()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.TensorNamespace.StringStringEntryProtogetExternalData(int index)Data can be stored inside the protobuf file using type-specific fields or raw_data.intgetExternalDataCount()Data can be stored inside the protobuf file using type-specific fields or raw_data.List<TensorNamespace.StringStringEntryProto>getExternalDataList()Data can be stored inside the protobuf file using type-specific fields or raw_data.TensorNamespace.StringStringEntryProtoOrBuildergetExternalDataOrBuilder(int index)Data can be stored inside the protobuf file using type-specific fields or raw_data.List<? extends TensorNamespace.StringStringEntryProtoOrBuilder>getExternalDataOrBuilderList()Data can be stored inside the protobuf file using type-specific fields or raw_data.floatgetFloatData(int index)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 position.intgetFloatDataCount()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 position.List<Float>getFloatDataList()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 position.intgetHalfVal(int index)For half values (tensorflow compatibility)intgetHalfValCount()For half values (tensorflow compatibility)List<Integer>getHalfValList()For half values (tensorflow compatibility)intgetInt32Data(int index)For int32, uint8, int8, uint16, int16, bool, and float16 values float16 values must be bit-wise converted to an uint16_t prior to writing to the buffer.intgetInt32DataCount()For int32, uint8, int8, uint16, int16, bool, and float16 values float16 values must be bit-wise converted to an uint16_t prior to writing to the buffer.List<Integer>getInt32DataList()For int32, uint8, int8, uint16, int16, bool, and float16 values float16 values must be bit-wise converted to an uint16_t prior to writing to the buffer.longgetInt64Data(int index)For int64.intgetInt64DataCount()For int64.List<Long>getInt64DataList()For int64.StringgetName()Optionally, a name for the tensor.org.nd4j.shade.protobuf.ByteStringgetNameBytes()Optionally, a name for the tensor.org.nd4j.shade.protobuf.Parser<TensorNamespace.TensorProto>getParserForType()org.nd4j.shade.protobuf.ByteStringgetRawData()Serializations can either use one of the fields above, or use this raw bytes field.TensorNamespace.TensorProto.SegmentgetSegment().org.nd4j.ir.TensorProto.Segment segment = 3;TensorNamespace.TensorProto.SegmentOrBuildergetSegmentOrBuilder().org.nd4j.ir.TensorProto.Segment segment = 3;intgetSerializedSize()org.nd4j.shade.protobuf.ByteStringgetStringData(int index)For strings.intgetStringDataCount()For strings.List<org.nd4j.shade.protobuf.ByteString>getStringDataList()For strings.longgetUint64Data(int index)For uint64 and uint32 values When this field is present, the data_type field MUST be UINT32 or UINT64intgetUint64DataCount()For uint64 and uint32 values When this field is present, the data_type field MUST be UINT32 or UINT64List<Long>getUint64DataList()For uint64 and uint32 values When this field is present, the data_type field MUST be UINT32 or UINT64org.nd4j.shade.protobuf.UnknownFieldSetgetUnknownFields()inthashCode()booleanhasSegment().org.nd4j.ir.TensorProto.Segment segment = 3;protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static TensorNamespace.TensorProto.BuildernewBuilder()static TensorNamespace.TensorProto.BuildernewBuilder(TensorNamespace.TensorProto prototype)TensorNamespace.TensorProto.BuildernewBuilderForType()protected TensorNamespace.TensorProto.BuildernewBuilderForType(org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent parent)protected ObjectnewInstance(org.nd4j.shade.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static TensorNamespace.TensorProtoparseDelimitedFrom(InputStream input)static TensorNamespace.TensorProtoparseDelimitedFrom(InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static TensorNamespace.TensorProtoparseFrom(byte[] data)static TensorNamespace.TensorProtoparseFrom(byte[] data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static TensorNamespace.TensorProtoparseFrom(InputStream input)static TensorNamespace.TensorProtoparseFrom(InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static TensorNamespace.TensorProtoparseFrom(ByteBuffer data)static TensorNamespace.TensorProtoparseFrom(ByteBuffer data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static TensorNamespace.TensorProtoparseFrom(org.nd4j.shade.protobuf.ByteString data)static TensorNamespace.TensorProtoparseFrom(org.nd4j.shade.protobuf.ByteString data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static TensorNamespace.TensorProtoparseFrom(org.nd4j.shade.protobuf.CodedInputStream input)static TensorNamespace.TensorProtoparseFrom(org.nd4j.shade.protobuf.CodedInputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static org.nd4j.shade.protobuf.Parser<TensorNamespace.TensorProto>parser()TensorNamespace.TensorProto.BuildertoBuilder()voidwriteTo(org.nd4j.shade.protobuf.CodedOutputStream output)-
Methods inherited from class org.nd4j.shade.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
-
Methods inherited from class org.nd4j.shade.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class org.nd4j.shade.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
DIMS_FIELD_NUMBER
public static final int DIMS_FIELD_NUMBER
- See Also:
- Constant Field Values
-
DATA_TYPE_FIELD_NUMBER
public static final int DATA_TYPE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
SEGMENT_FIELD_NUMBER
public static final int SEGMENT_FIELD_NUMBER
- See Also:
- Constant Field Values
-
FLOAT_DATA_FIELD_NUMBER
public static final int FLOAT_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
INT32_DATA_FIELD_NUMBER
public static final int INT32_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
STRING_DATA_FIELD_NUMBER
public static final int STRING_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
INT64_DATA_FIELD_NUMBER
public static final int INT64_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
DOC_STRING_FIELD_NUMBER
public static final int DOC_STRING_FIELD_NUMBER
- See Also:
- Constant Field Values
-
RAW_DATA_FIELD_NUMBER
public static final int RAW_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
EXTERNAL_DATA_FIELD_NUMBER
public static final int EXTERNAL_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
DATA_LOCATION_FIELD_NUMBER
public static final int DATA_LOCATION_FIELD_NUMBER
- See Also:
- Constant Field Values
-
DOUBLE_DATA_FIELD_NUMBER
public static final int DOUBLE_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
UINT64_DATA_FIELD_NUMBER
public static final int UINT64_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
HALF_VAL_FIELD_NUMBER
public static final int HALF_VAL_FIELD_NUMBER
- See Also:
- Constant Field Values
-
BOOL_VAL_FIELD_NUMBER
public static final int BOOL_VAL_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(org.nd4j.shade.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
getUnknownFields
public final org.nd4j.shade.protobuf.UnknownFieldSet getUnknownFields()
- Specified by:
getUnknownFieldsin interfaceorg.nd4j.shade.protobuf.MessageOrBuilder- Overrides:
getUnknownFieldsin classorg.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:
internalGetFieldAccessorTablein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
getDimsList
public List<Long> getDimsList()
The shape of the tensor.
repeated int64 dims = 1;- Specified by:
getDimsListin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- A list containing the dims.
-
getDimsCount
public int getDimsCount()
The shape of the tensor.
repeated int64 dims = 1;- Specified by:
getDimsCountin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The count of dims.
-
getDims
public long getDims(int index)
The shape of the tensor.
repeated int64 dims = 1;- Specified by:
getDimsin interfaceTensorNamespace.TensorProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The dims at the given index.
-
getDataType
public int getDataType()
The data type of the tensor. This field MUST have a valid TensorProto.DataType value
int32 data_type = 2;- Specified by:
getDataTypein interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The dataType.
-
hasSegment
public boolean hasSegment()
.org.nd4j.ir.TensorProto.Segment segment = 3;- Specified by:
hasSegmentin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- Whether the segment field is set.
-
getSegment
public TensorNamespace.TensorProto.Segment getSegment()
.org.nd4j.ir.TensorProto.Segment segment = 3;- Specified by:
getSegmentin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The segment.
-
getSegmentOrBuilder
public TensorNamespace.TensorProto.SegmentOrBuilder getSegmentOrBuilder()
.org.nd4j.ir.TensorProto.Segment segment = 3;- Specified by:
getSegmentOrBuilderin interfaceTensorNamespace.TensorProtoOrBuilder
-
getFloatDataList
public List<Float> getFloatDataList()
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 position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] is encoded as [1.0, 2.0 ,3.0 ,4.0] When this field is present, the data_type field MUST be FLOAT or COMPLEX64.
repeated float float_data = 4 [packed = true];- Specified by:
getFloatDataListin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- A list containing the floatData.
-
getFloatDataCount
public int getFloatDataCount()
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 position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] is encoded as [1.0, 2.0 ,3.0 ,4.0] When this field is present, the data_type field MUST be FLOAT or COMPLEX64.
repeated float float_data = 4 [packed = true];- Specified by:
getFloatDataCountin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The count of floatData.
-
getFloatData
public float getFloatData(int index)
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 position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] is encoded as [1.0, 2.0 ,3.0 ,4.0] When this field is present, the data_type field MUST be FLOAT or COMPLEX64.
repeated float float_data = 4 [packed = true];- Specified by:
getFloatDatain interfaceTensorNamespace.TensorProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The floatData at the given index.
-
getInt32DataList
public List<Integer> getInt32DataList()
For int32, uint8, int8, uint16, int16, bool, and float16 values float16 values must be bit-wise converted to an uint16_t prior to writing to the buffer. When this field is present, the data_type field MUST be INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16
repeated int32 int32_data = 5 [packed = true];- Specified by:
getInt32DataListin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- A list containing the int32Data.
-
getInt32DataCount
public int getInt32DataCount()
For int32, uint8, int8, uint16, int16, bool, and float16 values float16 values must be bit-wise converted to an uint16_t prior to writing to the buffer. When this field is present, the data_type field MUST be INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16
repeated int32 int32_data = 5 [packed = true];- Specified by:
getInt32DataCountin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The count of int32Data.
-
getInt32Data
public int getInt32Data(int index)
For int32, uint8, int8, uint16, int16, bool, and float16 values float16 values must be bit-wise converted to an uint16_t prior to writing to the buffer. When this field is present, the data_type field MUST be INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16
repeated int32 int32_data = 5 [packed = true];- Specified by:
getInt32Datain interfaceTensorNamespace.TensorProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The int32Data at the given index.
-
getStringDataList
public List<org.nd4j.shade.protobuf.ByteString> getStringDataList()
For strings. Each element of string_data is a UTF-8 encoded Unicode string. No trailing null, no leading BOM. The protobuf "string" scalar type is not used to match ML community conventions. When this field is present, the data_type field MUST be STRING
repeated bytes string_data = 6;- Specified by:
getStringDataListin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- A list containing the stringData.
-
getStringDataCount
public int getStringDataCount()
For strings. Each element of string_data is a UTF-8 encoded Unicode string. No trailing null, no leading BOM. The protobuf "string" scalar type is not used to match ML community conventions. When this field is present, the data_type field MUST be STRING
repeated bytes string_data = 6;- Specified by:
getStringDataCountin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The count of stringData.
-
getStringData
public org.nd4j.shade.protobuf.ByteString getStringData(int index)
For strings. Each element of string_data is a UTF-8 encoded Unicode string. No trailing null, no leading BOM. The protobuf "string" scalar type is not used to match ML community conventions. When this field is present, the data_type field MUST be STRING
repeated bytes string_data = 6;- Specified by:
getStringDatain interfaceTensorNamespace.TensorProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The stringData at the given index.
-
getInt64DataList
public List<Long> getInt64DataList()
For int64. When this field is present, the data_type field MUST be INT64
repeated int64 int64_data = 7 [packed = true];- Specified by:
getInt64DataListin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- A list containing the int64Data.
-
getInt64DataCount
public int getInt64DataCount()
For int64. When this field is present, the data_type field MUST be INT64
repeated int64 int64_data = 7 [packed = true];- Specified by:
getInt64DataCountin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The count of int64Data.
-
getInt64Data
public long getInt64Data(int index)
For int64. When this field is present, the data_type field MUST be INT64
repeated int64 int64_data = 7 [packed = true];- Specified by:
getInt64Datain interfaceTensorNamespace.TensorProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The int64Data at the given index.
-
getName
public String getName()
Optionally, a name for the tensor.
string name = 8;- Specified by:
getNamein interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The name.
-
getNameBytes
public org.nd4j.shade.protobuf.ByteString getNameBytes()
Optionally, a name for the tensor.
string name = 8;- Specified by:
getNameBytesin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The bytes for name.
-
getDocString
public String getDocString()
A human-readable documentation for this tensor. Markdown is allowed.
string doc_string = 12;- Specified by:
getDocStringin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The docString.
-
getDocStringBytes
public org.nd4j.shade.protobuf.ByteString getDocStringBytes()
A human-readable documentation for this tensor. Markdown is allowed.
string doc_string = 12;- Specified by:
getDocStringBytesin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The bytes for docString.
-
getRawData
public org.nd4j.shade.protobuf.ByteString getRawData()
Serializations can either use one of the fields above, or use this raw bytes field. The only exception is the string case, where one is required to store the content in the repeated bytes string_data field. When this raw_data field is used to store tensor value, elements MUST be stored in as fixed-width, little-endian order. Floating-point data types MUST be stored in IEEE 754 format. Complex64 elements must be written as two consecutive FLOAT values, real component first. Complex128 elements must be written as two consecutive DOUBLE values, real component first. Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false). Note: the advantage of specific field rather than the raw_data field is that in some cases (e.g. int data), protobuf does a better packing via variable length storage, and may lead to smaller binary footprint. When this field is present, the data_type field MUST NOT be STRING or UNDEFINED
bytes raw_data = 9;- Specified by:
getRawDatain interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The rawData.
-
getExternalDataList
public List<TensorNamespace.StringStringEntryProto> getExternalDataList()
Data can be stored inside the protobuf file using type-specific fields or raw_data. Alternatively, raw bytes data can be stored in an external file, using the external_data field. external_data stores key-value pairs describing data location. Recognized keys are: - "location" (required) - POSIX filesystem path relative to the directory where the ONNX protobuf model was stored - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. Offset values SHOULD be multiples 4096 (page size) to enable mmap support. - "length" (optional) - number of bytes containing data. Integer stored as string. - "checksum" (optional) - SHA1 digest of file specified in under 'location' key.repeated .org.nd4j.ir.StringStringEntryProto external_data = 13;- Specified by:
getExternalDataListin interfaceTensorNamespace.TensorProtoOrBuilder
-
getExternalDataOrBuilderList
public List<? extends TensorNamespace.StringStringEntryProtoOrBuilder> getExternalDataOrBuilderList()
Data can be stored inside the protobuf file using type-specific fields or raw_data. Alternatively, raw bytes data can be stored in an external file, using the external_data field. external_data stores key-value pairs describing data location. Recognized keys are: - "location" (required) - POSIX filesystem path relative to the directory where the ONNX protobuf model was stored - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. Offset values SHOULD be multiples 4096 (page size) to enable mmap support. - "length" (optional) - number of bytes containing data. Integer stored as string. - "checksum" (optional) - SHA1 digest of file specified in under 'location' key.repeated .org.nd4j.ir.StringStringEntryProto external_data = 13;- Specified by:
getExternalDataOrBuilderListin interfaceTensorNamespace.TensorProtoOrBuilder
-
getExternalDataCount
public int getExternalDataCount()
Data can be stored inside the protobuf file using type-specific fields or raw_data. Alternatively, raw bytes data can be stored in an external file, using the external_data field. external_data stores key-value pairs describing data location. Recognized keys are: - "location" (required) - POSIX filesystem path relative to the directory where the ONNX protobuf model was stored - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. Offset values SHOULD be multiples 4096 (page size) to enable mmap support. - "length" (optional) - number of bytes containing data. Integer stored as string. - "checksum" (optional) - SHA1 digest of file specified in under 'location' key.repeated .org.nd4j.ir.StringStringEntryProto external_data = 13;- Specified by:
getExternalDataCountin interfaceTensorNamespace.TensorProtoOrBuilder
-
getExternalData
public TensorNamespace.StringStringEntryProto getExternalData(int index)
Data can be stored inside the protobuf file using type-specific fields or raw_data. Alternatively, raw bytes data can be stored in an external file, using the external_data field. external_data stores key-value pairs describing data location. Recognized keys are: - "location" (required) - POSIX filesystem path relative to the directory where the ONNX protobuf model was stored - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. Offset values SHOULD be multiples 4096 (page size) to enable mmap support. - "length" (optional) - number of bytes containing data. Integer stored as string. - "checksum" (optional) - SHA1 digest of file specified in under 'location' key.repeated .org.nd4j.ir.StringStringEntryProto external_data = 13;- Specified by:
getExternalDatain interfaceTensorNamespace.TensorProtoOrBuilder
-
getExternalDataOrBuilder
public TensorNamespace.StringStringEntryProtoOrBuilder getExternalDataOrBuilder(int index)
Data can be stored inside the protobuf file using type-specific fields or raw_data. Alternatively, raw bytes data can be stored in an external file, using the external_data field. external_data stores key-value pairs describing data location. Recognized keys are: - "location" (required) - POSIX filesystem path relative to the directory where the ONNX protobuf model was stored - "offset" (optional) - position of byte at which stored data begins. Integer stored as string. Offset values SHOULD be multiples 4096 (page size) to enable mmap support. - "length" (optional) - number of bytes containing data. Integer stored as string. - "checksum" (optional) - SHA1 digest of file specified in under 'location' key.repeated .org.nd4j.ir.StringStringEntryProto external_data = 13;- Specified by:
getExternalDataOrBuilderin interfaceTensorNamespace.TensorProtoOrBuilder
-
getDataLocationValue
public int getDataLocationValue()
If value not set, data is stored in raw_data (if set) otherwise in type-specified field.
.org.nd4j.ir.TensorProto.DataLocation data_location = 14;- Specified by:
getDataLocationValuein interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The enum numeric value on the wire for dataLocation.
-
getDataLocation
public TensorNamespace.TensorProto.DataLocation getDataLocation()
If value not set, data is stored in raw_data (if set) otherwise in type-specified field.
.org.nd4j.ir.TensorProto.DataLocation data_location = 14;- Specified by:
getDataLocationin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The dataLocation.
-
getDoubleDataList
public List<Double> getDoubleDataList()
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. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] is encoded as [1.0, 2.0 ,3.0 ,4.0] When this field is present, the data_type field MUST be DOUBLE or COMPLEX128
repeated double double_data = 10 [packed = true];- Specified by:
getDoubleDataListin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- A list containing the doubleData.
-
getDoubleDataCount
public int getDoubleDataCount()
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. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] is encoded as [1.0, 2.0 ,3.0 ,4.0] When this field is present, the data_type field MUST be DOUBLE or COMPLEX128
repeated double double_data = 10 [packed = true];- Specified by:
getDoubleDataCountin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The count of doubleData.
-
getDoubleData
public double getDoubleData(int index)
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. (e.g., [1.0 + 2.0i, 3.0 + 4.0i] is encoded as [1.0, 2.0 ,3.0 ,4.0] When this field is present, the data_type field MUST be DOUBLE or COMPLEX128
repeated double double_data = 10 [packed = true];- Specified by:
getDoubleDatain interfaceTensorNamespace.TensorProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The doubleData at the given index.
-
getUint64DataList
public List<Long> getUint64DataList()
For uint64 and uint32 values When this field is present, the data_type field MUST be UINT32 or UINT64
repeated uint64 uint64_data = 11 [packed = true];- Specified by:
getUint64DataListin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- A list containing the uint64Data.
-
getUint64DataCount
public int getUint64DataCount()
For uint64 and uint32 values When this field is present, the data_type field MUST be UINT32 or UINT64
repeated uint64 uint64_data = 11 [packed = true];- Specified by:
getUint64DataCountin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The count of uint64Data.
-
getUint64Data
public long getUint64Data(int index)
For uint64 and uint32 values When this field is present, the data_type field MUST be UINT32 or UINT64
repeated uint64 uint64_data = 11 [packed = true];- Specified by:
getUint64Datain interfaceTensorNamespace.TensorProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The uint64Data at the given index.
-
getHalfValList
public List<Integer> getHalfValList()
For half values (tensorflow compatibility)
repeated int32 half_val = 15 [packed = true];- Specified by:
getHalfValListin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- A list containing the halfVal.
-
getHalfValCount
public int getHalfValCount()
For half values (tensorflow compatibility)
repeated int32 half_val = 15 [packed = true];- Specified by:
getHalfValCountin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The count of halfVal.
-
getHalfVal
public int getHalfVal(int index)
For half values (tensorflow compatibility)
repeated int32 half_val = 15 [packed = true];- Specified by:
getHalfValin interfaceTensorNamespace.TensorProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The halfVal at the given index.
-
getBoolValList
public List<Boolean> getBoolValList()
boolean values
repeated bool bool_val = 16 [packed = true];- Specified by:
getBoolValListin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- A list containing the boolVal.
-
getBoolValCount
public int getBoolValCount()
boolean values
repeated bool bool_val = 16 [packed = true];- Specified by:
getBoolValCountin interfaceTensorNamespace.TensorProtoOrBuilder- Returns:
- The count of boolVal.
-
getBoolVal
public boolean getBoolVal(int index)
boolean values
repeated bool bool_val = 16 [packed = true];- Specified by:
getBoolValin interfaceTensorNamespace.TensorProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The boolVal at the given index.
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfaceorg.nd4j.shade.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(org.nd4j.shade.protobuf.CodedOutputStream output) throws IOException- Specified by:
writeToin interfaceorg.nd4j.shade.protobuf.MessageLite- Overrides:
writeToin classorg.nd4j.shade.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfaceorg.nd4j.shade.protobuf.MessageLite- Overrides:
getSerializedSizein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceorg.nd4j.shade.protobuf.Message- Overrides:
equalsin classorg.nd4j.shade.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceorg.nd4j.shade.protobuf.Message- Overrides:
hashCodein classorg.nd4j.shade.protobuf.AbstractMessage
-
parseFrom
public static TensorNamespace.TensorProto parseFrom(ByteBuffer data) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TensorNamespace.TensorProto parseFrom(ByteBuffer data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TensorNamespace.TensorProto parseFrom(org.nd4j.shade.protobuf.ByteString data) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TensorNamespace.TensorProto 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 TensorNamespace.TensorProto parseFrom(byte[] data) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TensorNamespace.TensorProto parseFrom(byte[] data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TensorNamespace.TensorProto parseFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static TensorNamespace.TensorProto parseFrom(InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static TensorNamespace.TensorProto parseDelimitedFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static TensorNamespace.TensorProto parseDelimitedFrom(InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseFrom
public static TensorNamespace.TensorProto parseFrom(org.nd4j.shade.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static TensorNamespace.TensorProto parseFrom(org.nd4j.shade.protobuf.CodedInputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
newBuilderForType
public TensorNamespace.TensorProto.Builder newBuilderForType()
- Specified by:
newBuilderForTypein interfaceorg.nd4j.shade.protobuf.Message- Specified by:
newBuilderForTypein interfaceorg.nd4j.shade.protobuf.MessageLite
-
newBuilder
public static TensorNamespace.TensorProto.Builder newBuilder()
-
newBuilder
public static TensorNamespace.TensorProto.Builder newBuilder(TensorNamespace.TensorProto prototype)
-
toBuilder
public TensorNamespace.TensorProto.Builder toBuilder()
- Specified by:
toBuilderin interfaceorg.nd4j.shade.protobuf.Message- Specified by:
toBuilderin interfaceorg.nd4j.shade.protobuf.MessageLite
-
newBuilderForType
protected TensorNamespace.TensorProto.Builder newBuilderForType(org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static TensorNamespace.TensorProto getDefaultInstance()
-
parser
public static org.nd4j.shade.protobuf.Parser<TensorNamespace.TensorProto> parser()
-
getParserForType
public org.nd4j.shade.protobuf.Parser<TensorNamespace.TensorProto> getParserForType()
- Specified by:
getParserForTypein interfaceorg.nd4j.shade.protobuf.Message- Specified by:
getParserForTypein interfaceorg.nd4j.shade.protobuf.MessageLite- Overrides:
getParserForTypein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public TensorNamespace.TensorProto getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfaceorg.nd4j.shade.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfaceorg.nd4j.shade.protobuf.MessageOrBuilder
-
-