Class Tensor (3.30.0)

public final class Tensor extends GeneratedMessageV3 implements TensorOrBuilder

A tensor value type.

Protobuf type google.cloud.aiplatform.v1beta1.Tensor

Implements

TensorOrBuilder

Static Fields

BOOL_VAL_FIELD_NUMBER

public static final int BOOL_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

BYTES_VAL_FIELD_NUMBER

public static final int BYTES_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

DOUBLE_VAL_FIELD_NUMBER

public static final int DOUBLE_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

DTYPE_FIELD_NUMBER

public static final int DTYPE_FIELD_NUMBER
Field Value
TypeDescription
int

FLOAT_VAL_FIELD_NUMBER

public static final int FLOAT_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

INT64_VAL_FIELD_NUMBER

public static final int INT64_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

INT_VAL_FIELD_NUMBER

public static final int INT_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

LIST_VAL_FIELD_NUMBER

public static final int LIST_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

SHAPE_FIELD_NUMBER

public static final int SHAPE_FIELD_NUMBER
Field Value
TypeDescription
int

STRING_VAL_FIELD_NUMBER

public static final int STRING_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

STRUCT_VAL_FIELD_NUMBER

public static final int STRUCT_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

TENSOR_VAL_FIELD_NUMBER

public static final int TENSOR_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

UINT64_VAL_FIELD_NUMBER

public static final int UINT64_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

UINT_VAL_FIELD_NUMBER

public static final int UINT_VAL_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Tensor getDefaultInstance()
Returns
TypeDescription
Tensor

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Tensor.Builder newBuilder()
Returns
TypeDescription
Tensor.Builder

newBuilder(Tensor prototype)

public static Tensor.Builder newBuilder(Tensor prototype)
Parameter
NameDescription
prototypeTensor
Returns
TypeDescription
Tensor.Builder

parseDelimitedFrom(InputStream input)

public static Tensor parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Tensor parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Tensor parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Tensor parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Tensor parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Tensor parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Tensor parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Tensor parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Tensor
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Tensor> parser()
Returns
TypeDescription
Parser<Tensor>

Methods

containsStructVal(String key)

public boolean containsStructVal(String key)

A map of string to tensor.

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

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
List<Boolean>

A list containing the boolVal.

getBytesVal(int index)

public ByteString getBytesVal(int index)
STRING

repeated bytes bytes_val = 15;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
ByteString

The bytesVal at the given index.

getBytesValCount()

public int getBytesValCount()
STRING

repeated bytes bytes_val = 15;

Returns
TypeDescription
int

The count of bytesVal.

getBytesValList()

public List<ByteString> getBytesValList()
STRING

repeated bytes bytes_val = 15;

Returns
TypeDescription
List<ByteString>

A list containing the bytesVal.

getDefaultInstanceForType()

public Tensor getDefaultInstanceForType()
Returns
TypeDescription
Tensor

getDoubleVal(int index)

public double getDoubleVal(int index)
DOUBLE

repeated double double_val = 6;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
double

The doubleVal at the given index.

getDoubleValCount()

public int getDoubleValCount()
DOUBLE

repeated double double_val = 6;

Returns
TypeDescription
int

The count of doubleVal.

getDoubleValList()

public List<Double> getDoubleValList()
DOUBLE

repeated double double_val = 6;

Returns
TypeDescription
List<Double>

A list containing the doubleVal.

getDtype()

public Tensor.DataType getDtype()

The data type of tensor.

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

Returns
TypeDescription
Tensor.DataType

The dtype.

getDtypeValue()

public int getDtypeValue()

The data type of tensor.

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

Returns
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
float

The floatVal at the given index.

getFloatValCount()

public int getFloatValCount()
FLOAT

repeated float float_val = 5;

Returns
TypeDescription
int

The count of floatVal.

getFloatValList()

public List<Float> getFloatValList()
FLOAT

repeated float float_val = 5;

Returns
TypeDescription
List<Float>

A list containing the floatVal.

getInt64Val(int index)

public long getInt64Val(int index)
INT64

repeated int64 int64_val = 8;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
long

The int64Val at the given index.

getInt64ValCount()

public int getInt64ValCount()
INT64

repeated int64 int64_val = 8;

Returns
TypeDescription
int

The count of int64Val.

getInt64ValList()

public List<Long> getInt64ValList()
INT64

repeated int64 int64_val = 8;

Returns
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The intVal at the given index.

getIntValCount()

public int getIntValCount()
INT_8 INT_16 INT_32

repeated int32 int_val = 7;

Returns
TypeDescription
int

The count of intVal.

getIntValList()

public List<Integer> getIntValList()
INT_8 INT_16 INT_32

repeated int32 int_val = 7;

Returns
TypeDescription
List<Integer>

A list containing the intVal.

getListVal(int index)

public Tensor getListVal(int index)

A list of tensor values.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Tensor

getListValCount()

public int getListValCount()

A list of tensor values.

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

Returns
TypeDescription
int

getListValList()

public List<Tensor> getListValList()

A list of tensor values.

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

Returns
TypeDescription
List<Tensor>

getListValOrBuilder(int index)

public TensorOrBuilder getListValOrBuilder(int index)

A list of tensor values.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
TensorOrBuilder

getListValOrBuilderList()

public List<? extends TensorOrBuilder> getListValOrBuilderList()

A list of tensor values.

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

Returns
TypeDescription
List<? extends com.google.cloud.aiplatform.v1beta1.TensorOrBuilder>

getParserForType()

public Parser<Tensor> getParserForType()
Returns
TypeDescription
Parser<Tensor>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getShape(int index)

public long getShape(int index)

Shape of the tensor.

repeated int64 shape = 2;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
long

The shape at the given index.

getShapeCount()

public int getShapeCount()

Shape of the tensor.

repeated int64 shape = 2;

Returns
TypeDescription
int

The count of shape.

getShapeList()

public List<Long> getShapeList()

Shape of the tensor.

repeated int64 shape = 2;

Returns
TypeDescription
List<Long>

A list containing the shape.

getStringVal(int index)

public String getStringVal(int index)
STRING

repeated string string_val = 14;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The stringVal at the given index.

getStringValBytes(int index)

public ByteString getStringValBytes(int index)
STRING

repeated string string_val = 14;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the stringVal at the given index.

getStringValCount()

public int getStringValCount()
STRING

repeated string string_val = 14;

Returns
TypeDescription
int

The count of stringVal.

getStringValList()

public ProtocolStringList getStringValList()
STRING

repeated string string_val = 14;

Returns
TypeDescription
ProtocolStringList

A list containing the stringVal.

getStructVal()

public Map<String,Tensor> getStructVal()

Use #getStructValMap() instead.

Returns
TypeDescription
Map<String,Tensor>

getStructValCount()

public int getStructValCount()

A map of string to tensor.

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

Returns
TypeDescription
int

getStructValMap()

public Map<String,Tensor> getStructValMap()

A map of string to tensor.

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

Returns
TypeDescription
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.v1beta1.Tensor> struct_val = 12;

Parameters
NameDescription
keyString
defaultValueTensor
Returns
TypeDescription
Tensor

getStructValOrThrow(String key)

public Tensor getStructValOrThrow(String key)

A map of string to tensor.

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

Parameter
NameDescription
keyString
Returns
TypeDescription
Tensor

getTensorVal()

public ByteString getTensorVal()

Serialized raw tensor content.

bytes tensor_val = 13;

Returns
TypeDescription
ByteString

The tensorVal.

getUint64Val(int index)

public long getUint64Val(int index)
UINT64

repeated uint64 uint64_val = 10;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
long

The uint64Val at the given index.

getUint64ValCount()

public int getUint64ValCount()
UINT64

repeated uint64 uint64_val = 10;

Returns
TypeDescription
int

The count of uint64Val.

getUint64ValList()

public List<Long> getUint64ValList()
UINT64

repeated uint64 uint64_val = 10;

Returns
TypeDescription
List<Long>

A list containing the uint64Val.

getUintVal(int index)

public int getUintVal(int index)
UINT8 UINT16 UINT32

repeated uint32 uint_val = 9;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The uintVal at the given index.

getUintValCount()

public int getUintValCount()
UINT8 UINT16 UINT32

repeated uint32 uint_val = 9;

Returns
TypeDescription
int

The count of uintVal.

getUintValList()

public List<Integer> getUintValList()
UINT8 UINT16 UINT32

repeated uint32 uint_val = 9;

Returns
TypeDescription
List<Integer>

A list containing the uintVal.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Tensor.Builder newBuilderForType()
Returns
TypeDescription
Tensor.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Tensor.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Tensor.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Tensor.Builder toBuilder()
Returns
TypeDescription
Tensor.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException