Google Cloud Ai Platform V1 Client - Class Tensor (1.54.0)

Reference documentation and code samples for the Google Cloud Ai Platform V1 Client class Tensor.

A tensor value type.

Generated from protobuf message google.cloud.aiplatform.v1.Tensor

Namespace

Google \ Cloud \ AIPlatform \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ dtype int

The data type of tensor.

↳ shape int[]|string[]

Shape of the tensor.

↳ bool_val bool[]

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

↳ string_val string[]
STRING
↳ bytes_val string[]
STRING
↳ float_val float[]
FLOAT
↳ double_val float[]
DOUBLE
↳ int_val int[]
INT_8 INT_16 INT_32
↳ int64_val int[]|string[]
INT64
↳ uint_val int[]
UINT8 UINT16 UINT32
↳ uint64_val int[]|string[]
UINT64
↳ list_val array<Tensor>

A list of tensor values.

↳ struct_val array|Google\Protobuf\Internal\MapField

A map of string to tensor.

↳ tensor_val string

Serialized raw tensor content.

getDtype

The data type of tensor.

Returns
Type Description
int Enum of type DataType.

setDtype

The data type of tensor.

Parameter
Name Description
var int

Enum of type DataType.

Returns
Type Description
$this

getShape

Shape of the tensor.

Returns
Type Description
Google\Protobuf\RepeatedField<int>|Google\Protobuf\RepeatedField<string>

setShape

Shape of the tensor.

Parameter
Name Description
var int[]|string[]
Returns
Type Description
$this

getBoolVal

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
Returns
Type Description
Google\Protobuf\RepeatedField<bool>

setBoolVal

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
Parameter
Name Description
var bool[]
Returns
Type Description
$this

getStringVal

Returns
Type Description
Google\Protobuf\RepeatedField<string>

setStringVal

Parameter
Name Description
var string[]
Returns
Type Description
$this

getBytesVal

Returns
Type Description
Google\Protobuf\RepeatedField<string>

setBytesVal

Parameter
Name Description
var string[]
Returns
Type Description
$this

getFloatVal

Returns
Type Description
Google\Protobuf\RepeatedField<float>

setFloatVal

Parameter
Name Description
var float[]
Returns
Type Description
$this

getDoubleVal

Returns
Type Description
Google\Protobuf\RepeatedField<float>

setDoubleVal

Parameter
Name Description
var float[]
Returns
Type Description
$this

getIntVal

Returns
Type Description
Google\Protobuf\RepeatedField<int>

setIntVal

Parameter
Name Description
var int[]
Returns
Type Description
$this

getInt64Val

Returns
Type Description
Google\Protobuf\RepeatedField<int>|Google\Protobuf\RepeatedField<string>

setInt64Val

Parameter
Name Description
var int[]|string[]
Returns
Type Description
$this

getUintVal

Returns
Type Description
Google\Protobuf\RepeatedField<int>

setUintVal

Parameter
Name Description
var int[]
Returns
Type Description
$this

getUint64Val

Returns
Type Description
Google\Protobuf\RepeatedField<int>|Google\Protobuf\RepeatedField<string>

setUint64Val

Parameter
Name Description
var int[]|string[]
Returns
Type Description
$this

getListVal

A list of tensor values.

Returns
Type Description
Google\Protobuf\RepeatedField<Tensor>

setListVal

A list of tensor values.

Parameter
Name Description
var array<Tensor>
Returns
Type Description
$this

getStructVal

A map of string to tensor.

Returns
Type Description
Google\Protobuf\Internal\MapField

setStructVal

A map of string to tensor.

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this

getTensorVal

Serialized raw tensor content.

Returns
Type Description
string

setTensorVal

Serialized raw tensor content.

Parameter
Name Description
var string
Returns
Type Description
$this