@java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    getSerializedSize();
    if (dtype_ != com.google.cloud.vertexai.api.Tensor.DataType.DATA_TYPE_UNSPECIFIED.getNumber()) {
      output.writeEnum(1, dtype_);
    }
    if (getShapeList().size() > 0) {
      output.writeUInt32NoTag(18);
      output.writeUInt32NoTag(shapeMemoizedSerializedSize);
    }
    for (int i = 0; i < shape_.size(); i++) {
      output.writeInt64NoTag(shape_.getLong(i));
    }
    if (getBoolValList().size() > 0) {
      output.writeUInt32NoTag(26);
      output.writeUInt32NoTag(boolValMemoizedSerializedSize);
    }
    for (int i = 0; i < boolVal_.size(); i++) {
      output.writeBoolNoTag(boolVal_.getBoolean(i));
    }
    if (getFloatValList().size() > 0) {
      output.writeUInt32NoTag(42);
      output.writeUInt32NoTag(floatValMemoizedSerializedSize);
    }
    for (int i = 0; i < floatVal_.size(); i++) {
      output.writeFloatNoTag(floatVal_.getFloat(i));
    }
    if (getDoubleValList().size() > 0) {
      output.writeUInt32NoTag(50);
      output.writeUInt32NoTag(doubleValMemoizedSerializedSize);
    }
    for (int i = 0; i < doubleVal_.size(); i++) {
      output.writeDoubleNoTag(doubleVal_.getDouble(i));
    }
    if (getIntValList().size() > 0) {
      output.writeUInt32NoTag(58);
      output.writeUInt32NoTag(intValMemoizedSerializedSize);
    }
    for (int i = 0; i < intVal_.size(); i++) {
      output.writeInt32NoTag(intVal_.getInt(i));
    }
    if (getInt64ValList().size() > 0) {
      output.writeUInt32NoTag(66);
      output.writeUInt32NoTag(int64ValMemoizedSerializedSize);
    }
    for (int i = 0; i < int64Val_.size(); i++) {
      output.writeInt64NoTag(int64Val_.getLong(i));
    }
    if (getUintValList().size() > 0) {
      output.writeUInt32NoTag(74);
      output.writeUInt32NoTag(uintValMemoizedSerializedSize);
    }
    for (int i = 0; i < uintVal_.size(); i++) {
      output.writeUInt32NoTag(uintVal_.getInt(i));
    }
    if (getUint64ValList().size() > 0) {
      output.writeUInt32NoTag(82);
      output.writeUInt32NoTag(uint64ValMemoizedSerializedSize);
    }
    for (int i = 0; i < uint64Val_.size(); i++) {
      output.writeUInt64NoTag(uint64Val_.getLong(i));
    }
    for (int i = 0; i < listVal_.size(); i++) {
      output.writeMessage(11, listVal_.get(i));
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetStructVal(), StructValDefaultEntryHolder.defaultEntry, 12);
    if (!tensorVal_.isEmpty()) {
      output.writeBytes(13, tensorVal_);
    }
    for (int i = 0; i < stringVal_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 14, stringVal_.getRaw(i));
    }
    for (int i = 0; i < bytesVal_.size(); i++) {
      output.writeBytes(15, bytesVal_.get(i));
    }
    getUnknownFields().writeTo(output);
  }
<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