<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/types.proto

namespace Google\Cloud\AIPlatform\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A tensor value type.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.Tensor</code>
 */
class Tensor extends \Google\Protobuf\Internal\Message
{
    /**
     * The data type of tensor.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Tensor.DataType dtype = 1;</code>
     */
    protected $dtype = 0;
    /**
     * Shape of the tensor.
     *
     * Generated from protobuf field <code>repeated int64 shape = 2;</code>
     */
    private $shape;
    /**
     * 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][google.cloud.aiplatform.v1.Tensor.DataType.BOOL]
     *
     * Generated from protobuf field <code>repeated bool bool_val = 3;</code>
     */
    private $bool_val;
    /**
     * [STRING][google.cloud.aiplatform.v1.Tensor.DataType.STRING]
     *
     * Generated from protobuf field <code>repeated string string_val = 14;</code>
     */
    private $string_val;
    /**
     * [STRING][google.cloud.aiplatform.v1.Tensor.DataType.STRING]
     *
     * Generated from protobuf field <code>repeated bytes bytes_val = 15;</code>
     */
    private $bytes_val;
    /**
     * [FLOAT][google.cloud.aiplatform.v1.Tensor.DataType.FLOAT]
     *
     * Generated from protobuf field <code>repeated float float_val = 5;</code>
     */
    private $float_val;
    /**
     * [DOUBLE][google.cloud.aiplatform.v1.Tensor.DataType.DOUBLE]
     *
     * Generated from protobuf field <code>repeated double double_val = 6;</code>
     */
    private $double_val;
    /**
     * [INT_8][google.cloud.aiplatform.v1.Tensor.DataType.INT8]
     * [INT_16][google.cloud.aiplatform.v1.Tensor.DataType.INT16]
     * [INT_32][google.cloud.aiplatform.v1.Tensor.DataType.INT32]
     *
     * Generated from protobuf field <code>repeated int32 int_val = 7;</code>
     */
    private $int_val;
    /**
     * [INT64][google.cloud.aiplatform.v1.Tensor.DataType.INT64]
     *
     * Generated from protobuf field <code>repeated int64 int64_val = 8;</code>
     */
    private $int64_val;
    /**
     * [UINT8][google.cloud.aiplatform.v1.Tensor.DataType.UINT8]
     * [UINT16][google.cloud.aiplatform.v1.Tensor.DataType.UINT16]
     * [UINT32][google.cloud.aiplatform.v1.Tensor.DataType.UINT32]
     *
     * Generated from protobuf field <code>repeated uint32 uint_val = 9;</code>
     */
    private $uint_val;
    /**
     * [UINT64][google.cloud.aiplatform.v1.Tensor.DataType.UINT64]
     *
     * Generated from protobuf field <code>repeated uint64 uint64_val = 10;</code>
     */
    private $uint64_val;
    /**
     * A list of tensor values.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Tensor list_val = 11;</code>
     */
    private $list_val;
    /**
     * A map of string to tensor.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.aiplatform.v1.Tensor> struct_val = 12;</code>
     */
    private $struct_val;
    /**
     * Serialized raw tensor content.
     *
     * Generated from protobuf field <code>bytes tensor_val = 13;</code>
     */
    protected $tensor_val = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $dtype
     *           The data type of tensor.
     *     @type array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $shape
     *           Shape of the tensor.
     *     @type array<bool>|\Google\Protobuf\Internal\RepeatedField $bool_val
     *           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][google.cloud.aiplatform.v1.Tensor.DataType.BOOL]
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $string_val
     *           [STRING][google.cloud.aiplatform.v1.Tensor.DataType.STRING]
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $bytes_val
     *           [STRING][google.cloud.aiplatform.v1.Tensor.DataType.STRING]
     *     @type array<float>|\Google\Protobuf\Internal\RepeatedField $float_val
     *           [FLOAT][google.cloud.aiplatform.v1.Tensor.DataType.FLOAT]
     *     @type array<float>|\Google\Protobuf\Internal\RepeatedField $double_val
     *           [DOUBLE][google.cloud.aiplatform.v1.Tensor.DataType.DOUBLE]
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $int_val
     *           [INT_8][google.cloud.aiplatform.v1.Tensor.DataType.INT8]
     *           [INT_16][google.cloud.aiplatform.v1.Tensor.DataType.INT16]
     *           [INT_32][google.cloud.aiplatform.v1.Tensor.DataType.INT32]
     *     @type array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $int64_val
     *           [INT64][google.cloud.aiplatform.v1.Tensor.DataType.INT64]
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $uint_val
     *           [UINT8][google.cloud.aiplatform.v1.Tensor.DataType.UINT8]
     *           [UINT16][google.cloud.aiplatform.v1.Tensor.DataType.UINT16]
     *           [UINT32][google.cloud.aiplatform.v1.Tensor.DataType.UINT32]
     *     @type array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $uint64_val
     *           [UINT64][google.cloud.aiplatform.v1.Tensor.DataType.UINT64]
     *     @type array<\Google\Cloud\AIPlatform\V1\Tensor>|\Google\Protobuf\Internal\RepeatedField $list_val
     *           A list of tensor values.
     *     @type array|\Google\Protobuf\Internal\MapField $struct_val
     *           A map of string to tensor.
     *     @type string $tensor_val
     *           Serialized raw tensor content.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Types::initOnce();
        parent::__construct($data);
    }

    /**
     * The data type of tensor.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Tensor.DataType dtype = 1;</code>
     * @return int
     */
    public function getDtype()
    {
        return $this->dtype;
    }

    /**
     * The data type of tensor.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Tensor.DataType dtype = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setDtype($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\Tensor\DataType::class);
        $this->dtype = $var;

        return $this;
    }

    /**
     * Shape of the tensor.
     *
     * Generated from protobuf field <code>repeated int64 shape = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getShape()
    {
        return $this->shape;
    }

    /**
     * Shape of the tensor.
     *
     * Generated from protobuf field <code>repeated int64 shape = 2;</code>
     * @param array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setShape($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64);
        $this->shape = $arr;

        return $this;
    }

    /**
     * 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][google.cloud.aiplatform.v1.Tensor.DataType.BOOL]
     *
     * Generated from protobuf field <code>repeated bool bool_val = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getBoolVal()
    {
        return $this->bool_val;
    }

    /**
     * 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][google.cloud.aiplatform.v1.Tensor.DataType.BOOL]
     *
     * Generated from protobuf field <code>repeated bool bool_val = 3;</code>
     * @param array<bool>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setBoolVal($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BOOL);
        $this->bool_val = $arr;

        return $this;
    }

    /**
     * [STRING][google.cloud.aiplatform.v1.Tensor.DataType.STRING]
     *
     * Generated from protobuf field <code>repeated string string_val = 14;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getStringVal()
    {
        return $this->string_val;
    }

    /**
     * [STRING][google.cloud.aiplatform.v1.Tensor.DataType.STRING]
     *
     * Generated from protobuf field <code>repeated string string_val = 14;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setStringVal($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->string_val = $arr;

        return $this;
    }

    /**
     * [STRING][google.cloud.aiplatform.v1.Tensor.DataType.STRING]
     *
     * Generated from protobuf field <code>repeated bytes bytes_val = 15;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getBytesVal()
    {
        return $this->bytes_val;
    }

    /**
     * [STRING][google.cloud.aiplatform.v1.Tensor.DataType.STRING]
     *
     * Generated from protobuf field <code>repeated bytes bytes_val = 15;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setBytesVal($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES);
        $this->bytes_val = $arr;

        return $this;
    }

    /**
     * [FLOAT][google.cloud.aiplatform.v1.Tensor.DataType.FLOAT]
     *
     * Generated from protobuf field <code>repeated float float_val = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getFloatVal()
    {
        return $this->float_val;
    }

    /**
     * [FLOAT][google.cloud.aiplatform.v1.Tensor.DataType.FLOAT]
     *
     * Generated from protobuf field <code>repeated float float_val = 5;</code>
     * @param array<float>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setFloatVal($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FLOAT);
        $this->float_val = $arr;

        return $this;
    }

    /**
     * [DOUBLE][google.cloud.aiplatform.v1.Tensor.DataType.DOUBLE]
     *
     * Generated from protobuf field <code>repeated double double_val = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDoubleVal()
    {
        return $this->double_val;
    }

    /**
     * [DOUBLE][google.cloud.aiplatform.v1.Tensor.DataType.DOUBLE]
     *
     * Generated from protobuf field <code>repeated double double_val = 6;</code>
     * @param array<float>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDoubleVal($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE);
        $this->double_val = $arr;

        return $this;
    }

    /**
     * [INT_8][google.cloud.aiplatform.v1.Tensor.DataType.INT8]
     * [INT_16][google.cloud.aiplatform.v1.Tensor.DataType.INT16]
     * [INT_32][google.cloud.aiplatform.v1.Tensor.DataType.INT32]
     *
     * Generated from protobuf field <code>repeated int32 int_val = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getIntVal()
    {
        return $this->int_val;
    }

    /**
     * [INT_8][google.cloud.aiplatform.v1.Tensor.DataType.INT8]
     * [INT_16][google.cloud.aiplatform.v1.Tensor.DataType.INT16]
     * [INT_32][google.cloud.aiplatform.v1.Tensor.DataType.INT32]
     *
     * Generated from protobuf field <code>repeated int32 int_val = 7;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setIntVal($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->int_val = $arr;

        return $this;
    }

    /**
     * [INT64][google.cloud.aiplatform.v1.Tensor.DataType.INT64]
     *
     * Generated from protobuf field <code>repeated int64 int64_val = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getInt64Val()
    {
        return $this->int64_val;
    }

    /**
     * [INT64][google.cloud.aiplatform.v1.Tensor.DataType.INT64]
     *
     * Generated from protobuf field <code>repeated int64 int64_val = 8;</code>
     * @param array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setInt64Val($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64);
        $this->int64_val = $arr;

        return $this;
    }

    /**
     * [UINT8][google.cloud.aiplatform.v1.Tensor.DataType.UINT8]
     * [UINT16][google.cloud.aiplatform.v1.Tensor.DataType.UINT16]
     * [UINT32][google.cloud.aiplatform.v1.Tensor.DataType.UINT32]
     *
     * Generated from protobuf field <code>repeated uint32 uint_val = 9;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getUintVal()
    {
        return $this->uint_val;
    }

    /**
     * [UINT8][google.cloud.aiplatform.v1.Tensor.DataType.UINT8]
     * [UINT16][google.cloud.aiplatform.v1.Tensor.DataType.UINT16]
     * [UINT32][google.cloud.aiplatform.v1.Tensor.DataType.UINT32]
     *
     * Generated from protobuf field <code>repeated uint32 uint_val = 9;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setUintVal($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::UINT32);
        $this->uint_val = $arr;

        return $this;
    }

    /**
     * [UINT64][google.cloud.aiplatform.v1.Tensor.DataType.UINT64]
     *
     * Generated from protobuf field <code>repeated uint64 uint64_val = 10;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getUint64Val()
    {
        return $this->uint64_val;
    }

    /**
     * [UINT64][google.cloud.aiplatform.v1.Tensor.DataType.UINT64]
     *
     * Generated from protobuf field <code>repeated uint64 uint64_val = 10;</code>
     * @param array<int>|array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setUint64Val($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::UINT64);
        $this->uint64_val = $arr;

        return $this;
    }

    /**
     * A list of tensor values.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Tensor list_val = 11;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getListVal()
    {
        return $this->list_val;
    }

    /**
     * A list of tensor values.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Tensor list_val = 11;</code>
     * @param array<\Google\Cloud\AIPlatform\V1\Tensor>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setListVal($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Tensor::class);
        $this->list_val = $arr;

        return $this;
    }

    /**
     * A map of string to tensor.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.aiplatform.v1.Tensor> struct_val = 12;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getStructVal()
    {
        return $this->struct_val;
    }

    /**
     * A map of string to tensor.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.aiplatform.v1.Tensor> struct_val = 12;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setStructVal($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Tensor::class);
        $this->struct_val = $arr;

        return $this;
    }

    /**
     * Serialized raw tensor content.
     *
     * Generated from protobuf field <code>bytes tensor_val = 13;</code>
     * @return string
     */
    public function getTensorVal()
    {
        return $this->tensor_val;
    }

    /**
     * Serialized raw tensor content.
     *
     * Generated from protobuf field <code>bytes tensor_val = 13;</code>
     * @param string $var
     * @return $this
     */
    public function setTensorVal($var)
    {
        GPBUtil::checkString($var, False);
        $this->tensor_val = $var;

        return $this;
    }

}

