@java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (dtype_ != com.google.cloud.vertexai.api.Tensor.DataType.DATA_TYPE_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, dtype_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < shape_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(shape_.getLong(i));
      }
      size += dataSize;
      if (!getShapeList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      shapeMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      dataSize = 1 * getBoolValList().size();
      size += dataSize;
      if (!getBoolValList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      boolValMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      dataSize = 4 * getFloatValList().size();
      size += dataSize;
      if (!getFloatValList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      floatValMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      dataSize = 8 * getDoubleValList().size();
      size += dataSize;
      if (!getDoubleValList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      doubleValMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      for (int i = 0; i < intVal_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(intVal_.getInt(i));
      }
      size += dataSize;
      if (!getIntValList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      intValMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      for (int i = 0; i < int64Val_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(int64Val_.getLong(i));
      }
      size += dataSize;
      if (!getInt64ValList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      int64ValMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      for (int i = 0; i < uintVal_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(uintVal_.getInt(i));
      }
      size += dataSize;
      if (!getUintValList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      uintValMemoizedSerializedSize = dataSize;
    }
    {
      int dataSize = 0;
      for (int i = 0; i < uint64Val_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeUInt64SizeNoTag(uint64Val_.getLong(i));
      }
      size += dataSize;
      if (!getUint64ValList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      uint64ValMemoizedSerializedSize = dataSize;
    }
    for (int i = 0; i < listVal_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, listVal_.get(i));
    }
    for (java.util.Map.Entry<java.lang.String, com.google.cloud.vertexai.api.Tensor> entry :
        internalGetStructVal().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, com.google.cloud.vertexai.api.Tensor>
          structVal__ =
              StructValDefaultEntryHolder.defaultEntry
                  .newBuilderForType()
                  .setKey(entry.getKey())
                  .setValue(entry.getValue())
                  .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, structVal__);
    }
    if (!tensorVal_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream.computeBytesSize(13, tensorVal_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < stringVal_.size(); i++) {
        dataSize += computeStringSizeNoTag(stringVal_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getStringValList().size();
    }
    {
      int dataSize = 0;
      for (int i = 0; i < bytesVal_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(bytesVal_.get(i));
      }
      size += dataSize;
      size += 1 * getBytesValList().size();
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }
<pre>
Serialized raw tensor content.
</pre>

<code>bytes tensor_val = 13;</code>

@return The tensorVal.
java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/Tensor.java