Class Tensor (3.46.0)

public final class Tensor extends GeneratedMessageV3 implements TensorOrBuilder

A tensor value type.

Protobuf type google.cloud.aiplatform.v1.Tensor

Implements

TensorOrBuilder

Static Fields

BOOL_VAL_FIELD_NUMBER

public static final int BOOL_VAL_FIELD_NUMBER
Field Value
Type Description
int

BYTES_VAL_FIELD_NUMBER

public static final int BYTES_VAL_FIELD_NUMBER
Field Value
Type Description
int

DOUBLE_VAL_FIELD_NUMBER

public static final int DOUBLE_VAL_FIELD_NUMBER
Field Value
Type Description
int

DTYPE_FIELD_NUMBER

public static final int DTYPE_FIELD_NUMBER
Field Value
Type Description
int

FLOAT_VAL_FIELD_NUMBER

public static final int FLOAT_VAL_FIELD_NUMBER
Field Value
Type Description
int

INT64_VAL_FIELD_NUMBER

public static final int INT64_VAL_FIELD_NUMBER
Field Value
Type Description
int

INT_VAL_FIELD_NUMBER

public static final int INT_VAL_FIELD_NUMBER
Field Value
Type Description
int

LIST_VAL_FIELD_NUMBER

public static final int LIST_VAL_FIELD_NUMBER
Field Value
Type Description
int

SHAPE_FIELD_NUMBER

public static final int SHAPE_FIELD_NUMBER
Field Value
Type Description
int

STRING_VAL_FIELD_NUMBER

public static final int STRING_VAL_FIELD_NUMBER
Field Value
Type Description
int

STRUCT_VAL_FIELD_NUMBER

public static final int STRUCT_VAL_FIELD_NUMBER
Field Value
Type Description
int

TENSOR_VAL_FIELD_NUMBER

public static final int TENSOR_VAL_FIELD_NUMBER
Field Value
Type Description
int

UINT64_VAL_FIELD_NUMBER

public static final int UINT64_VAL_FIELD_NUMBER
Field Value
Type Description
int

UINT_VAL_FIELD_NUMBER

public static final int UINT_VAL_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Tensor getDefaultInstance()
Returns
Type Description
Tensor

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Tensor.Builder newBuilder()
Returns
Type Description
Tensor.Builder

newBuilder(Tensor prototype)

public static Tensor.Builder newBuilder(Tensor prototype)
Parameter
Name Description
prototype Tensor
Returns
Type Description
Tensor.Builder

parseDelimitedFrom(InputStream input)

public static Tensor parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Tensor parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Tensor parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Tensor parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Tensor parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Tensor parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Tensor parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Tensor> parser()
Returns
Type Description
Parser<Tensor>

Methods

containsStructVal(String key)

public boolean containsStructVal(String key)

A map of string to tensor.

map<string, .google.cloud.aiplatform.v1.Tensor> struct_val = 12;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getBoolVal(int index)

public boolean getBoolVal(int index)

Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order.

BOOL

repeated bool bool_val = 3;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
boolean

The boolVal at the given index.

getBoolValCount()

public int getBoolValCount()

Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order.

BOOL

repeated bool bool_val = 3;

Returns
Type Description
int

The count of boolVal.

getBoolValList()

public List<Boolean> getBoolValList()

Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order.

BOOL

repeated bool bool_val = 3;

Returns
Type Description
List<Boolean>

A list containing the boolVal.

getBytesVal(int index)

public ByteString getBytesVal(int index)
STRING

repeated bytes bytes_val = 15;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
ByteString

The bytesVal at the given index.

getBytesValCount()

public int getBytesValCount()
STRING

repeated bytes bytes_val = 15;

Returns
Type Description
int

The count of bytesVal.

getBytesValList()

public List<ByteString> getBytesValList()
STRING

repeated bytes bytes_val = 15;

Returns
Type Description
List<ByteString>

A list containing the bytesVal.

getDefaultInstanceForType()

public Tensor getDefaultInstanceForType()
Returns
Type Description
Tensor

getDoubleVal(int index)

public double getDoubleVal(int index)
DOUBLE

repeated double double_val = 6;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
double

The doubleVal at the given index.

getDoubleValCount()

public int getDoubleValCount()
DOUBLE

repeated double double_val = 6;

Returns
Type Description
int

The count of doubleVal.

getDoubleValList()

public List<Double> getDoubleValList()
DOUBLE

repeated double double_val = 6;

Returns
Type Description
List<Double>

A list containing the doubleVal.

getDtype()

public Tensor.DataType getDtype()

The data type of tensor.

.google.cloud.aiplatform.v1.Tensor.DataType dtype = 1;

Returns
Type Description
Tensor.DataType

The dtype.

getDtypeValue()

public int getDtypeValue()

The data type of tensor.

.google.cloud.aiplatform.v1.Tensor.DataType dtype = 1;

Returns
Type Description
int

The enum numeric value on the wire for dtype.

getFloatVal(int index)

public float getFloatVal(int index)
FLOAT

repeated float float_val = 5;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
float

The floatVal at the given index.

getFloatValCount()

public int getFloatValCount()
FLOAT

repeated float float_val = 5;

Returns
Type Description
int

The count of floatVal.

getFloatValList()

public List<Float> getFloatValList()
FLOAT

repeated float float_val = 5;

Returns
Type Description
List<Float>

A list containing the floatVal.

getInt64Val(int index)

public long getInt64Val(int index)
INT64

repeated int64 int64_val = 8;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
long

The int64Val at the given index.

getInt64ValCount()

public int getInt64ValCount()
INT64

repeated int64 int64_val = 8;

Returns
Type Description
int

The count of int64Val.

getInt64ValList()

public List<Long> getInt64ValList()
INT64

repeated int64 int64_val = 8;

Returns
Type Description
List<Long>

A list containing the int64Val.

getIntVal(int index)

public int getIntVal(int index)
INT_8 INT_16 INT_32

repeated int32 int_val = 7;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
int

The intVal at the given index.

getIntValCount()

public int getIntValCount()
INT_8 INT_16 INT_32

repeated int32 int_val = 7;

Returns
Type Description
int

The count of intVal.

getIntValList()

public List<Integer> getIntValList()
INT_8 INT_16 INT_32

repeated int32 int_val = 7;

Returns
Type Description
List<Integer>

A list containing the intVal.

getListVal(int index)

public Tensor getListVal(int index)

A list of tensor values.

repeated .google.cloud.aiplatform.v1.Tensor list_val = 11;

Parameter
Name Description
index int
Returns
Type Description
Tensor

getListValCount()

public int getListValCount()

A list of tensor values.

repeated .google.cloud.aiplatform.v1.Tensor list_val = 11;

Returns
Type Description
int

getListValList()

public List<Tensor> getListValList()

A list of tensor values.

repeated .google.cloud.aiplatform.v1.Tensor list_val = 11;

Returns
Type Description
List<Tensor>

getListValOrBuilder(int index)

public TensorOrBuilder getListValOrBuilder(int index)

A list of tensor values.

repeated .google.cloud.aiplatform.v1.Tensor list_val = 11;

Parameter
Name Description
index int
Returns
Type Description
TensorOrBuilder

getListValOrBuilderList()

public List<? extends TensorOrBuilder> getListValOrBuilderList()

A list of tensor values.

repeated .google.cloud.aiplatform.v1.Tensor list_val = 11;

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1.TensorOrBuilder>

getParserForType()

public Parser<Tensor> getParserForType()
Returns
Type Description
Parser<Tensor>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getShape(int index)

public long getShape(int index)

Shape of the tensor.

repeated int64 shape = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
long

The shape at the given index.

getShapeCount()

public int getShapeCount()

Shape of the tensor.

repeated int64 shape = 2;

Returns
Type Description
int

The count of shape.

getShapeList()

public List<Long> getShapeList()

Shape of the tensor.

repeated int64 shape = 2;

Returns
Type Description
List<Long>

A list containing the shape.

getStringVal(int index)

public String getStringVal(int index)
STRING

repeated string string_val = 14;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The stringVal at the given index.

getStringValBytes(int index)

public ByteString getStringValBytes(int index)
STRING

repeated string string_val = 14;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the stringVal at the given index.

getStringValCount()

public int getStringValCount()
STRING

repeated string string_val = 14;

Returns
Type Description
int

The count of stringVal.

getStringValList()

public ProtocolStringList getStringValList()
STRING

repeated string string_val = 14;

Returns
Type Description
ProtocolStringList

A list containing the stringVal.

getStructVal() (deprecated)

public Map<String,Tensor> getStructVal()

Use #getStructValMap() instead.

Returns
Type Description
Map<String,Tensor>

getStructValCount()

public int getStructValCount()

A map of string to tensor.

map<string, .google.cloud.aiplatform.v1.Tensor> struct_val = 12;

Returns
Type Description
int

getStructValMap()

public Map<String,Tensor> getStructValMap()

A map of string to tensor.

map<string, .google.cloud.aiplatform.v1.Tensor> struct_val = 12;

Returns
Type Description
Map<String,Tensor>

getStructValOrDefault(String key, Tensor defaultValue)

public Tensor getStructValOrDefault(String key, Tensor defaultValue)

A map of string to tensor.

map<string, .google.cloud.aiplatform.v1.Tensor> struct_val = 12;

Parameters
Name Description
key String
defaultValue Tensor
Returns
Type Description
Tensor

getStructValOrThrow(String key)

public Tensor getStructValOrThrow(String key)

A map of string to tensor.

map<string, .google.cloud.aiplatform.v1.Tensor> struct_val = 12;

Parameter
Name Description
key String
Returns
Type Description
Tensor

getTensorVal()

public ByteString getTensorVal()

Serialized raw tensor content.

bytes tensor_val = 13;

Returns
Type Description
ByteString

The tensorVal.

getUint64Val(int index)

public long getUint64Val(int index)
UINT64

repeated uint64 uint64_val = 10;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
long

The uint64Val at the given index.

getUint64ValCount()

public int getUint64ValCount()
UINT64

repeated uint64 uint64_val = 10;

Returns
Type Description
int

The count of uint64Val.

getUint64ValList()

public List<Long> getUint64ValList()
UINT64

repeated uint64 uint64_val = 10;

Returns
Type Description
List<Long>

A list containing the uint64Val.

getUintVal(int index)

public int getUintVal(int index)
UINT8 UINT16 UINT32

repeated uint32 uint_val = 9;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
int

The uintVal at the given index.

getUintValCount()

public int getUintValCount()
UINT8 UINT16 UINT32

repeated uint32 uint_val = 9;

Returns
Type Description
int

The count of uintVal.

getUintValList()

public List<Integer> getUintValList()
UINT8 UINT16 UINT32

repeated uint32 uint_val = 9;

Returns
Type Description
List<Integer>

A list containing the uintVal.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Tensor.Builder newBuilderForType()
Returns
Type Description
Tensor.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Tensor.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Tensor.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Tensor.Builder toBuilder()
Returns
Type Description
Tensor.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException