Class Tensor (0.5.0)

publicfinalclass TensorextendsGeneratedMessageV3implementsTensorOrBuilder

A tensor value type.

Protobuf type google.cloud.vertexai.v1.Tensor

Implements

TensorOrBuilder

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

BOOL_VAL_FIELD_NUMBER

publicstaticfinalintBOOL_VAL_FIELD_NUMBER
Field Value
Type Description
int

BYTES_VAL_FIELD_NUMBER

publicstaticfinalintBYTES_VAL_FIELD_NUMBER
Field Value
Type Description
int

DOUBLE_VAL_FIELD_NUMBER

publicstaticfinalintDOUBLE_VAL_FIELD_NUMBER
Field Value
Type Description
int

DTYPE_FIELD_NUMBER

publicstaticfinalintDTYPE_FIELD_NUMBER
Field Value
Type Description
int

FLOAT_VAL_FIELD_NUMBER

publicstaticfinalintFLOAT_VAL_FIELD_NUMBER
Field Value
Type Description
int

INT64_VAL_FIELD_NUMBER

publicstaticfinalintINT64_VAL_FIELD_NUMBER
Field Value
Type Description
int

INT_VAL_FIELD_NUMBER

publicstaticfinalintINT_VAL_FIELD_NUMBER
Field Value
Type Description
int

LIST_VAL_FIELD_NUMBER

publicstaticfinalintLIST_VAL_FIELD_NUMBER
Field Value
Type Description
int

SHAPE_FIELD_NUMBER

publicstaticfinalintSHAPE_FIELD_NUMBER
Field Value
Type Description
int

STRING_VAL_FIELD_NUMBER

publicstaticfinalintSTRING_VAL_FIELD_NUMBER
Field Value
Type Description
int

STRUCT_VAL_FIELD_NUMBER

publicstaticfinalintSTRUCT_VAL_FIELD_NUMBER
Field Value
Type Description
int

TENSOR_VAL_FIELD_NUMBER

publicstaticfinalintTENSOR_VAL_FIELD_NUMBER
Field Value
Type Description
int

UINT64_VAL_FIELD_NUMBER

publicstaticfinalintUINT64_VAL_FIELD_NUMBER
Field Value
Type Description
int

UINT_VAL_FIELD_NUMBER

publicstaticfinalintUINT_VAL_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticTensorgetDefaultInstance()
Returns
Type Description
Tensor

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticTensor.BuildernewBuilder()
Returns
Type Description
Tensor.Builder

newBuilder(Tensor prototype)

publicstaticTensor.BuildernewBuilder(Tensorprototype)
Parameter
Name Description
prototype Tensor
Returns
Type Description
Tensor.Builder

parseDelimitedFrom(InputStream input)

publicstaticTensorparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticTensorparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticTensorparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticTensorparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticTensorparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticTensorparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticTensorparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticTensorparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticTensorparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticTensorparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticTensorparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticTensorparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Tensor
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<Tensor>parser()
Returns
Type Description
Parser<Tensor>

Methods

containsStructVal(String key)

publicbooleancontainsStructVal(Stringkey)

A map of string to tensor.

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

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getBoolVal(int index)

publicbooleangetBoolVal(intindex)

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()

publicintgetBoolValCount()

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()

publicList<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)

publicByteStringgetBytesVal(intindex)
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()

publicintgetBytesValCount()
STRING

repeated bytes bytes_val = 15;

Returns
Type Description
int

The count of bytesVal.

getBytesValList()

publicList<ByteString>getBytesValList()
STRING

repeated bytes bytes_val = 15;

Returns
Type Description
List<ByteString>

A list containing the bytesVal.

getDefaultInstanceForType()

publicTensorgetDefaultInstanceForType()
Returns
Type Description
Tensor

getDoubleVal(int index)

publicdoublegetDoubleVal(intindex)
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()

publicintgetDoubleValCount()
DOUBLE

repeated double double_val = 6;

Returns
Type Description
int

The count of doubleVal.

getDoubleValList()

publicList<Double>getDoubleValList()
DOUBLE

repeated double double_val = 6;

Returns
Type Description
List<Double>

A list containing the doubleVal.

getDtype()

publicTensor.DataTypegetDtype()

The data type of tensor.

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

Returns
Type Description
Tensor.DataType

The dtype.

getDtypeValue()

publicintgetDtypeValue()

The data type of tensor.

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

Returns
Type Description
int

The enum numeric value on the wire for dtype.

getFloatVal(int index)

publicfloatgetFloatVal(intindex)
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()

publicintgetFloatValCount()
FLOAT

repeated float float_val = 5;

Returns
Type Description
int

The count of floatVal.

getFloatValList()

publicList<Float>getFloatValList()
FLOAT

repeated float float_val = 5;

Returns
Type Description
List<Float>

A list containing the floatVal.

getInt64Val(int index)

publiclonggetInt64Val(intindex)
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()

publicintgetInt64ValCount()
INT64

repeated int64 int64_val = 8;

Returns
Type Description
int

The count of int64Val.

getInt64ValList()

publicList<Long>getInt64ValList()
INT64

repeated int64 int64_val = 8;

Returns
Type Description
List<Long>

A list containing the int64Val.

getIntVal(int index)

publicintgetIntVal(intindex)
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()

publicintgetIntValCount()
INT_8 INT_16 INT_32

repeated int32 int_val = 7;

Returns
Type Description
int

The count of intVal.

getIntValList()

publicList<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)

publicTensorgetListVal(intindex)

A list of tensor values.

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

Parameter
Name Description
index int
Returns
Type Description
Tensor

getListValCount()

publicintgetListValCount()

A list of tensor values.

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

Returns
Type Description
int

getListValList()

publicList<Tensor>getListValList()

A list of tensor values.

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

Returns
Type Description
List<Tensor>

getListValOrBuilder(int index)

publicTensorOrBuildergetListValOrBuilder(intindex)

A list of tensor values.

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

Parameter
Name Description
index int
Returns
Type Description
TensorOrBuilder

getListValOrBuilderList()

publicList<?extendsTensorOrBuilder>getListValOrBuilderList()

A list of tensor values.

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

Returns
Type Description
List<? extends com.google.cloud.vertexai.api.TensorOrBuilder>

getParserForType()

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

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getShape(int index)

publiclonggetShape(intindex)

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()

publicintgetShapeCount()

Shape of the tensor.

repeated int64 shape = 2;

Returns
Type Description
int

The count of shape.

getShapeList()

publicList<Long>getShapeList()

Shape of the tensor.

repeated int64 shape = 2;

Returns
Type Description
List<Long>

A list containing the shape.

getStringVal(int index)

publicStringgetStringVal(intindex)
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)

publicByteStringgetStringValBytes(intindex)
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()

publicintgetStringValCount()
STRING

repeated string string_val = 14;

Returns
Type Description
int

The count of stringVal.

getStringValList()

publicProtocolStringListgetStringValList()
STRING

repeated string string_val = 14;

Returns
Type Description
ProtocolStringList

A list containing the stringVal.

getStructVal() (deprecated)

publicMap<String,Tensor>getStructVal()

Use #getStructValMap() instead.

Returns
Type Description
Map<String,Tensor>

getStructValCount()

publicintgetStructValCount()

A map of string to tensor.

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

Returns
Type Description
int

getStructValMap()

publicMap<String,Tensor>getStructValMap()

A map of string to tensor.

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

Returns
Type Description
Map<String,Tensor>

getStructValOrDefault(String key, Tensor defaultValue)

publicTensorgetStructValOrDefault(Stringkey,TensordefaultValue)

A map of string to tensor.

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

Parameters
Name Description
key String
defaultValue Tensor
Returns
Type Description
Tensor

getStructValOrThrow(String key)

publicTensorgetStructValOrThrow(Stringkey)

A map of string to tensor.

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

Parameter
Name Description
key String
Returns
Type Description
Tensor

getTensorVal()

publicByteStringgetTensorVal()

Serialized raw tensor content.

bytes tensor_val = 13;

Returns
Type Description
ByteString

The tensorVal.

getUint64Val(int index)

publiclonggetUint64Val(intindex)
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()

publicintgetUint64ValCount()
UINT64

repeated uint64 uint64_val = 10;

Returns
Type Description
int

The count of uint64Val.

getUint64ValList()

publicList<Long>getUint64ValList()
UINT64

repeated uint64 uint64_val = 10;

Returns
Type Description
List<Long>

A list containing the uint64Val.

getUintVal(int index)

publicintgetUintVal(intindex)
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()

publicintgetUintValCount()
UINT8 UINT16 UINT32

repeated uint32 uint_val = 9;

Returns
Type Description
int

The count of uintVal.

getUintValList()

publicList<Integer>getUintValList()
UINT8 UINT16 UINT32

repeated uint32 uint_val = 9;

Returns
Type Description
List<Integer>

A list containing the uintVal.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

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

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicTensor.BuildernewBuilderForType()
Returns
Type Description
Tensor.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedTensor.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Tensor.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicTensor.BuildertoBuilder()
Returns
Type Description
Tensor.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.