/*
  Copyright 2021 The TensorFlow Authors. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 ==============================================================================
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/framework/attr_value.proto

package org.tensorflow.proto.framework;

/**
 * <pre>
 * Protocol buffer representing the value for an attr used to configure an Op.
 * Comment indicates the corresponding attr type.  Only the field matching the
 * attr type may be filled.
 * </pre>
 *
 * Protobuf type {@code tensorflow.AttrValue}
 */
public  final class AttrValue extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.AttrValue)
    AttrValueOrBuilder {
private static final long serialVersionUID = 0L;

  // Use AttrValue.newBuilder() to construct.
  private AttrValue(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private AttrValue() {
  }

  @Override
  @SuppressWarnings({"unused"})
  protected Object newInstance(
      UnusedPrivateParameter unused) {
    return new AttrValue();
  }

  @Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }

  private AttrValue(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            ListValue.Builder subBuilder = null;
            if (valueCase_ == 1) {
              subBuilder = ((ListValue) value_).toBuilder();
            }
            value_ =
                input.readMessage(ListValue.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((ListValue) value_);
              value_ = subBuilder.buildPartial();
            }
            valueCase_ = 1;
            break;
          }
          case 18: {
            valueCase_ = 2;
            value_ = input.readBytes();
            break;
          }
          case 24: {
            valueCase_ = 3;
            value_ = input.readInt64();
            break;
          }
          case 37: {
            valueCase_ = 4;
            value_ = input.readFloat();
            break;
          }
          case 40: {
            valueCase_ = 5;
            value_ = input.readBool();
            break;
          }
          case 48: {
            int rawValue = input.readEnum();
            valueCase_ = 6;
            value_ = rawValue;
            break;
          }
          case 58: {
            TensorShapeProto.Builder subBuilder = null;
            if (valueCase_ == 7) {
              subBuilder = ((TensorShapeProto) value_).toBuilder();
            }
            value_ =
                input.readMessage(TensorShapeProto.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((TensorShapeProto) value_);
              value_ = subBuilder.buildPartial();
            }
            valueCase_ = 7;
            break;
          }
          case 66: {
            TensorProto.Builder subBuilder = null;
            if (valueCase_ == 8) {
              subBuilder = ((TensorProto) value_).toBuilder();
            }
            value_ =
                input.readMessage(TensorProto.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((TensorProto) value_);
              value_ = subBuilder.buildPartial();
            }
            valueCase_ = 8;
            break;
          }
          case 74: {
            String s = input.readStringRequireUtf8();
            valueCase_ = 9;
            value_ = s;
            break;
          }
          case 82: {
            NameAttrList.Builder subBuilder = null;
            if (valueCase_ == 10) {
              subBuilder = ((NameAttrList) value_).toBuilder();
            }
            value_ =
                input.readMessage(NameAttrList.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((NameAttrList) value_);
              value_ = subBuilder.buildPartial();
            }
            valueCase_ = 10;
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor
  getDescriptor() {
    return AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor;
  }

  @Override
  protected FieldAccessorTable
  internalGetFieldAccessorTable() {
    return AttrValueProtos.internal_static_tensorflow_AttrValue_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            AttrValue.class, Builder.class);
  }

  public interface ListValueOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.AttrValue.ListValue)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * "list(string)"
     * </pre>
     *
     * <code>repeated bytes s = 2;</code>
     */
    java.util.List<com.google.protobuf.ByteString> getSList();

    /**
     * <pre>
     * "list(string)"
     * </pre>
     *
     * <code>repeated bytes s = 2;</code>
     */
    int getSCount();

    /**
     * <pre>
     * "list(string)"
     * </pre>
     *
     * <code>repeated bytes s = 2;</code>
     */
    com.google.protobuf.ByteString getS(int index);

    /**
     * <pre>
     * "list(int)"
     * </pre>
     *
     * <code>repeated int64 i = 3 [packed = true];</code>
     */
    java.util.List<Long> getIList();

    /**
     * <pre>
     * "list(int)"
     * </pre>
     *
     * <code>repeated int64 i = 3 [packed = true];</code>
     */
    int getICount();

    /**
     * <pre>
     * "list(int)"
     * </pre>
     *
     * <code>repeated int64 i = 3 [packed = true];</code>
     */
    long getI(int index);

    /**
     * <pre>
     * "list(float)"
     * </pre>
     *
     * <code>repeated float f = 4 [packed = true];</code>
     */
    java.util.List<Float> getFList();

    /**
     * <pre>
     * "list(float)"
     * </pre>
     *
     * <code>repeated float f = 4 [packed = true];</code>
     */
    int getFCount();

    /**
     * <pre>
     * "list(float)"
     * </pre>
     *
     * <code>repeated float f = 4 [packed = true];</code>
     */
    float getF(int index);

    /**
     * <pre>
     * "list(bool)"
     * </pre>
     *
     * <code>repeated bool b = 5 [packed = true];</code>
     */
    java.util.List<Boolean> getBList();

    /**
     * <pre>
     * "list(bool)"
     * </pre>
     *
     * <code>repeated bool b = 5 [packed = true];</code>
     */
    int getBCount();

    /**
     * <pre>
     * "list(bool)"
     * </pre>
     *
     * <code>repeated bool b = 5 [packed = true];</code>
     */
    boolean getB(int index);

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    java.util.List<DataType> getTypeList();

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    int getTypeCount();

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    DataType getType(int index);

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    java.util.List<Integer>
    getTypeValueList();

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    int getTypeValue(int index);

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    java.util.List<TensorShapeProto>
    getShapeList();

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    TensorShapeProto getShape(int index);

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    int getShapeCount();

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    java.util.List<? extends TensorShapeProtoOrBuilder>
    getShapeOrBuilderList();

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    TensorShapeProtoOrBuilder getShapeOrBuilder(
        int index);

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    java.util.List<TensorProto>
    getTensorList();

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    TensorProto getTensor(int index);

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    int getTensorCount();

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    java.util.List<? extends TensorProtoOrBuilder>
    getTensorOrBuilderList();

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    TensorProtoOrBuilder getTensorOrBuilder(
        int index);

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    java.util.List<NameAttrList>
    getFuncList();

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    NameAttrList getFunc(int index);

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    int getFuncCount();

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    java.util.List<? extends NameAttrListOrBuilder>
    getFuncOrBuilderList();

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    NameAttrListOrBuilder getFuncOrBuilder(
        int index);
  }

  /**
   * <pre>
   * LINT.IfChange
   * </pre>
   *
   * Protobuf type {@code tensorflow.AttrValue.ListValue}
   */
  public  static final class ListValue extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.AttrValue.ListValue)
      ListValueOrBuilder {

    private static final long serialVersionUID = 0L;

    // Use ListValue.newBuilder() to construct.
    private ListValue(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private ListValue() {
      s_ = java.util.Collections.emptyList();
      i_ = emptyLongList();
      f_ = emptyFloatList();
      b_ = emptyBooleanList();
      type_ = java.util.Collections.emptyList();
      shape_ = java.util.Collections.emptyList();
      tensor_ = java.util.Collections.emptyList();
      func_ = java.util.Collections.emptyList();
    }

    @Override
    @SuppressWarnings({"unused"})
    protected Object newInstance(
        UnusedPrivateParameter unused) {
      return new ListValue();
    }

    @Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }

    private ListValue(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 18: {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                s_ = new java.util.ArrayList<com.google.protobuf.ByteString>();
                mutable_bitField0_ |= 0x00000001;
              }
              s_.add(input.readBytes());
              break;
            }
            case 24: {
              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
                i_ = newLongList();
                mutable_bitField0_ |= 0x00000002;
              }
              i_.addLong(input.readInt64());
              break;
            }
            case 26: {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) {
                i_ = newLongList();
                mutable_bitField0_ |= 0x00000002;
              }
              while (input.getBytesUntilLimit() > 0) {
                i_.addLong(input.readInt64());
              }
              input.popLimit(limit);
              break;
            }
            case 37: {
              if (!((mutable_bitField0_ & 0x00000004) != 0)) {
                f_ = newFloatList();
                mutable_bitField0_ |= 0x00000004;
              }
              f_.addFloat(input.readFloat());
              break;
            }
            case 34: {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) {
                f_ = newFloatList();
                mutable_bitField0_ |= 0x00000004;
              }
              while (input.getBytesUntilLimit() > 0) {
                f_.addFloat(input.readFloat());
              }
              input.popLimit(limit);
              break;
            }
            case 40: {
              if (!((mutable_bitField0_ & 0x00000008) != 0)) {
                b_ = newBooleanList();
                mutable_bitField0_ |= 0x00000008;
              }
              b_.addBoolean(input.readBool());
              break;
            }
            case 42: {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000008) != 0) && input.getBytesUntilLimit() > 0) {
                b_ = newBooleanList();
                mutable_bitField0_ |= 0x00000008;
              }
              while (input.getBytesUntilLimit() > 0) {
                b_.addBoolean(input.readBool());
              }
              input.popLimit(limit);
              break;
            }
            case 48: {
              int rawValue = input.readEnum();
              if (!((mutable_bitField0_ & 0x00000010) != 0)) {
                type_ = new java.util.ArrayList<Integer>();
                mutable_bitField0_ |= 0x00000010;
              }
              type_.add(rawValue);
              break;
            }
            case 50: {
              int length = input.readRawVarint32();
              int oldLimit = input.pushLimit(length);
              while(input.getBytesUntilLimit() > 0) {
                int rawValue = input.readEnum();
                if (!((mutable_bitField0_ & 0x00000010) != 0)) {
                  type_ = new java.util.ArrayList<Integer>();
                  mutable_bitField0_ |= 0x00000010;
                }
                type_.add(rawValue);
              }
              input.popLimit(oldLimit);
              break;
            }
            case 58: {
              if (!((mutable_bitField0_ & 0x00000020) != 0)) {
                shape_ = new java.util.ArrayList<TensorShapeProto>();
                mutable_bitField0_ |= 0x00000020;
              }
              shape_.add(
                  input.readMessage(TensorShapeProto.parser(), extensionRegistry));
              break;
            }
            case 66: {
              if (!((mutable_bitField0_ & 0x00000040) != 0)) {
                tensor_ = new java.util.ArrayList<TensorProto>();
                mutable_bitField0_ |= 0x00000040;
              }
              tensor_.add(
                  input.readMessage(TensorProto.parser(), extensionRegistry));
              break;
            }
            case 74: {
              if (!((mutable_bitField0_ & 0x00000080) != 0)) {
                func_ = new java.util.ArrayList<NameAttrList>();
                mutable_bitField0_ |= 0x00000080;
              }
              func_.add(
                  input.readMessage(NameAttrList.parser(), extensionRegistry));
              break;
            }
            default: {
              if (!parseUnknownField(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000001) != 0)) {
          s_ = java.util.Collections.unmodifiableList(s_); // C
        }
        if (((mutable_bitField0_ & 0x00000002) != 0)) {
          i_.makeImmutable(); // C
        }
        if (((mutable_bitField0_ & 0x00000004) != 0)) {
          f_.makeImmutable(); // C
        }
        if (((mutable_bitField0_ & 0x00000008) != 0)) {
          b_.makeImmutable(); // C
        }
        if (((mutable_bitField0_ & 0x00000010) != 0)) {
          type_ = java.util.Collections.unmodifiableList(type_);
        }
        if (((mutable_bitField0_ & 0x00000020) != 0)) {
          shape_ = java.util.Collections.unmodifiableList(shape_);
        }
        if (((mutable_bitField0_ & 0x00000040) != 0)) {
          tensor_ = java.util.Collections.unmodifiableList(tensor_);
        }
        if (((mutable_bitField0_ & 0x00000080) != 0)) {
          func_ = java.util.Collections.unmodifiableList(func_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor
    getDescriptor() {
      return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor;
    }

    @Override
    protected FieldAccessorTable
    internalGetFieldAccessorTable() {
      return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              ListValue.class, Builder.class);
    }

    public static final int S_FIELD_NUMBER = 2;
    private java.util.List<com.google.protobuf.ByteString> s_;

    /**
     * <pre>
     * "list(string)"
     * </pre>
     *
     * <code>repeated bytes s = 2;</code>
     */
    public java.util.List<com.google.protobuf.ByteString>
    getSList() {
      return s_;
    }

    /**
     * <pre>
     * "list(string)"
     * </pre>
     *
     * <code>repeated bytes s = 2;</code>
     */
    public int getSCount() {
      return s_.size();
    }

    /**
     * <pre>
     * "list(string)"
     * </pre>
     *
     * <code>repeated bytes s = 2;</code>
     */
    public com.google.protobuf.ByteString getS(int index) {
      return s_.get(index);
    }

    public static final int I_FIELD_NUMBER = 3;
    private com.google.protobuf.Internal.LongList i_;

    /**
     * <pre>
     * "list(int)"
     * </pre>
     *
     * <code>repeated int64 i = 3 [packed = true];</code>
     */
    public java.util.List<Long>
    getIList() {
      return i_;
    }

    /**
     * <pre>
     * "list(int)"
     * </pre>
     *
     * <code>repeated int64 i = 3 [packed = true];</code>
     */
    public int getICount() {
      return i_.size();
    }

    /**
     * <pre>
     * "list(int)"
     * </pre>
     *
     * <code>repeated int64 i = 3 [packed = true];</code>
     */
    public long getI(int index) {
      return i_.getLong(index);
    }

    private int iMemoizedSerializedSize = -1;

    public static final int F_FIELD_NUMBER = 4;
    private com.google.protobuf.Internal.FloatList f_;

    /**
     * <pre>
     * "list(float)"
     * </pre>
     *
     * <code>repeated float f = 4 [packed = true];</code>
     */
    public java.util.List<Float>
    getFList() {
      return f_;
    }

    /**
     * <pre>
     * "list(float)"
     * </pre>
     *
     * <code>repeated float f = 4 [packed = true];</code>
     */
    public int getFCount() {
      return f_.size();
    }

    /**
     * <pre>
     * "list(float)"
     * </pre>
     *
     * <code>repeated float f = 4 [packed = true];</code>
     */
    public float getF(int index) {
      return f_.getFloat(index);
    }

    private int fMemoizedSerializedSize = -1;

    public static final int B_FIELD_NUMBER = 5;
    private com.google.protobuf.Internal.BooleanList b_;

    /**
     * <pre>
     * "list(bool)"
     * </pre>
     *
     * <code>repeated bool b = 5 [packed = true];</code>
     */
    public java.util.List<Boolean>
    getBList() {
      return b_;
    }

    /**
     * <pre>
     * "list(bool)"
     * </pre>
     *
     * <code>repeated bool b = 5 [packed = true];</code>
     */
    public int getBCount() {
      return b_.size();
    }

    /**
     * <pre>
     * "list(bool)"
     * </pre>
     *
     * <code>repeated bool b = 5 [packed = true];</code>
     */
    public boolean getB(int index) {
      return b_.getBoolean(index);
    }

    private int bMemoizedSerializedSize = -1;

    public static final int TYPE_FIELD_NUMBER = 6;
    private java.util.List<Integer> type_;
    private static final com.google.protobuf.Internal.ListAdapter.Converter<
        Integer, DataType> type_converter_ =
        new com.google.protobuf.Internal.ListAdapter.Converter<
            Integer, DataType>() {
          public DataType convert(Integer from) {
            @SuppressWarnings("deprecation")
            DataType result = DataType.valueOf(from);
            return result == null ? DataType.UNRECOGNIZED : result;
          }
        };

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    public java.util.List<DataType> getTypeList() {
      return new com.google.protobuf.Internal.ListAdapter<
          Integer, DataType>(type_, type_converter_);
    }

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    public int getTypeCount() {
      return type_.size();
    }

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    public DataType getType(int index) {
      return type_converter_.convert(type_.get(index));
    }

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    public java.util.List<Integer>
    getTypeValueList() {
      return type_;
    }

    /**
     * <pre>
     * "list(type)"
     * </pre>
     *
     * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
     */
    public int getTypeValue(int index) {
      return type_.get(index);
    }

    private int typeMemoizedSerializedSize;

    public static final int SHAPE_FIELD_NUMBER = 7;
    private java.util.List<TensorShapeProto> shape_;

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    public java.util.List<TensorShapeProto> getShapeList() {
      return shape_;
    }

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    public java.util.List<? extends TensorShapeProtoOrBuilder>
    getShapeOrBuilderList() {
      return shape_;
    }

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    public int getShapeCount() {
      return shape_.size();
    }

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    public TensorShapeProto getShape(int index) {
      return shape_.get(index);
    }

    /**
     * <pre>
     * "list(shape)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
     */
    public TensorShapeProtoOrBuilder getShapeOrBuilder(
        int index) {
      return shape_.get(index);
    }

    public static final int TENSOR_FIELD_NUMBER = 8;
    private java.util.List<TensorProto> tensor_;

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    public java.util.List<TensorProto> getTensorList() {
      return tensor_;
    }

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    public java.util.List<? extends TensorProtoOrBuilder>
    getTensorOrBuilderList() {
      return tensor_;
    }

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    public int getTensorCount() {
      return tensor_.size();
    }

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    public TensorProto getTensor(int index) {
      return tensor_.get(index);
    }

    /**
     * <pre>
     * "list(tensor)"
     * </pre>
     *
     * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
     */
    public TensorProtoOrBuilder getTensorOrBuilder(
        int index) {
      return tensor_.get(index);
    }

    public static final int FUNC_FIELD_NUMBER = 9;
    private java.util.List<NameAttrList> func_;

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    public java.util.List<NameAttrList> getFuncList() {
      return func_;
    }

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    public java.util.List<? extends NameAttrListOrBuilder>
    getFuncOrBuilderList() {
      return func_;
    }

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    public int getFuncCount() {
      return func_.size();
    }

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    public NameAttrList getFunc(int index) {
      return func_.get(index);
    }

    /**
     * <pre>
     * "list(attr)"
     * </pre>
     *
     * <code>repeated .tensorflow.NameAttrList func = 9;</code>
     */
    public NameAttrListOrBuilder getFuncOrBuilder(
        int index) {
      return func_.get(index);
    }

    private byte memoizedIsInitialized = -1;

    @Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
        throws java.io.IOException {
      getSerializedSize();
      for (int i = 0; i < s_.size(); i++) {
        output.writeBytes(2, s_.get(i));
      }
      if (getIList().size() > 0) {
        output.writeUInt32NoTag(26);
        output.writeUInt32NoTag(iMemoizedSerializedSize);
      }
      for (int i = 0; i < i_.size(); i++) {
        output.writeInt64NoTag(i_.getLong(i));
      }
      if (getFList().size() > 0) {
        output.writeUInt32NoTag(34);
        output.writeUInt32NoTag(fMemoizedSerializedSize);
      }
      for (int i = 0; i < f_.size(); i++) {
        output.writeFloatNoTag(f_.getFloat(i));
      }
      if (getBList().size() > 0) {
        output.writeUInt32NoTag(42);
        output.writeUInt32NoTag(bMemoizedSerializedSize);
      }
      for (int i = 0; i < b_.size(); i++) {
        output.writeBoolNoTag(b_.getBoolean(i));
      }
      if (getTypeList().size() > 0) {
        output.writeUInt32NoTag(50);
        output.writeUInt32NoTag(typeMemoizedSerializedSize);
      }
      for (int i = 0; i < type_.size(); i++) {
        output.writeEnumNoTag(type_.get(i));
      }
      for (int i = 0; i < shape_.size(); i++) {
        output.writeMessage(7, shape_.get(i));
      }
      for (int i = 0; i < tensor_.size(); i++) {
        output.writeMessage(8, tensor_.get(i));
      }
      for (int i = 0; i < func_.size(); i++) {
        output.writeMessage(9, func_.get(i));
      }
      unknownFields.writeTo(output);
    }

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

      size = 0;
      {
        int dataSize = 0;
        for (int i = 0; i < s_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
              .computeBytesSizeNoTag(s_.get(i));
        }
        size += dataSize;
        size += 1 * getSList().size();
      }
      {
        int dataSize = 0;
        for (int i = 0; i < i_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
              .computeInt64SizeNoTag(i_.getLong(i));
        }
        size += dataSize;
        if (!getIList().isEmpty()) {
          size += 1;
          size += com.google.protobuf.CodedOutputStream
              .computeInt32SizeNoTag(dataSize);
        }
        iMemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        dataSize = 4 * getFList().size();
        size += dataSize;
        if (!getFList().isEmpty()) {
          size += 1;
          size += com.google.protobuf.CodedOutputStream
              .computeInt32SizeNoTag(dataSize);
        }
        fMemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        dataSize = 1 * getBList().size();
        size += dataSize;
        if (!getBList().isEmpty()) {
          size += 1;
          size += com.google.protobuf.CodedOutputStream
              .computeInt32SizeNoTag(dataSize);
        }
        bMemoizedSerializedSize = dataSize;
      }
      {
        int dataSize = 0;
        for (int i = 0; i < type_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
              .computeEnumSizeNoTag(type_.get(i));
        }
        size += dataSize;
        if (!getTypeList().isEmpty()) {  size += 1;
          size += com.google.protobuf.CodedOutputStream
              .computeUInt32SizeNoTag(dataSize);
        }typeMemoizedSerializedSize = dataSize;
      }
      for (int i = 0; i < shape_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(7, shape_.get(i));
      }
      for (int i = 0; i < tensor_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(8, tensor_.get(i));
      }
      for (int i = 0; i < func_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(9, func_.get(i));
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @Override
    public boolean equals(final Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj instanceof ListValue)) {
        return super.equals(obj);
      }
      ListValue other = (ListValue) obj;

      if (!getSList()
          .equals(other.getSList())) {
        return false;
      }
      if (!getIList()
          .equals(other.getIList())) return false;
      if (!getFList()
          .equals(other.getFList())) return false;
      if (!getBList()
          .equals(other.getBList())) return false;
      if (!type_.equals(other.type_)) return false;
      if (!getShapeList()
          .equals(other.getShapeList())) return false;
      if (!getTensorList()
          .equals(other.getTensorList())) return false;
      if (!getFuncList()
          .equals(other.getFuncList())) return false;
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (getSCount() > 0) {
        hash = (37 * hash) + S_FIELD_NUMBER;
        hash = (53 * hash) + getSList().hashCode();
      }
      if (getICount() > 0) {
        hash = (37 * hash) + I_FIELD_NUMBER;
        hash = (53 * hash) + getIList().hashCode();
      }
      if (getFCount() > 0) {
        hash = (37 * hash) + F_FIELD_NUMBER;
        hash = (53 * hash) + getFList().hashCode();
      }
      if (getBCount() > 0) {
        hash = (37 * hash) + B_FIELD_NUMBER;
        hash = (53 * hash) + getBList().hashCode();
      }
      if (getTypeCount() > 0) {
        hash = (37 * hash) + TYPE_FIELD_NUMBER;
        hash = (53 * hash) + type_.hashCode();
      }
      if (getShapeCount() > 0) {
        hash = (37 * hash) + SHAPE_FIELD_NUMBER;
        hash = (53 * hash) + getShapeList().hashCode();
      }
      if (getTensorCount() > 0) {
        hash = (37 * hash) + TENSOR_FIELD_NUMBER;
        hash = (53 * hash) + getTensorList().hashCode();
      }
      if (getFuncCount() > 0) {
        hash = (37 * hash) + FUNC_FIELD_NUMBER;
        hash = (53 * hash) + getFuncList().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static ListValue parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static ListValue parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static ListValue parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static ListValue parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static ListValue parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static ListValue parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static ListValue parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }

    public static ListValue parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static ListValue parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }

    public static ListValue parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }

    public static ListValue parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }

    public static ListValue parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @Override
    public Builder newBuilderForType() { return newBuilder(); }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(ListValue prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @Override
    protected Builder newBuilderForType(
        BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }

    /**
     * <pre>
     * LINT.IfChange
     * </pre>
     *
     * Protobuf type {@code tensorflow.AttrValue.ListValue}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.AttrValue.ListValue)
        ListValueOrBuilder {

      public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
        return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor;
      }

      @Override
      protected FieldAccessorTable
      internalGetFieldAccessorTable() {
        return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                ListValue.class, Builder.class);
      }

      // Construct using org.tensorflow.proto.framework.AttrValue.ListValue.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
            .alwaysUseFieldBuilders) {
          getShapeFieldBuilder();
          getTensorFieldBuilder();
          getFuncFieldBuilder();
        }
      }

      @Override
      public Builder clear() {
        super.clear();
        s_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        i_ = emptyLongList();
        bitField0_ = (bitField0_ & ~0x00000002);
        f_ = emptyFloatList();
        bitField0_ = (bitField0_ & ~0x00000004);
        b_ = emptyBooleanList();
        bitField0_ = (bitField0_ & ~0x00000008);
        type_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000010);
        if (shapeBuilder_ == null) {
          shape_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000020);
        } else {
          shapeBuilder_.clear();
        }
        if (tensorBuilder_ == null) {
          tensor_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000040);
        } else {
          tensorBuilder_.clear();
        }
        if (funcBuilder_ == null) {
          func_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000080);
        } else {
          funcBuilder_.clear();
        }
        return this;
      }

      @Override
      public com.google.protobuf.Descriptors.Descriptor
      getDescriptorForType() {
        return AttrValueProtos.internal_static_tensorflow_AttrValue_ListValue_descriptor;
      }

      @Override
      public ListValue getDefaultInstanceForType() {
        return ListValue.getDefaultInstance();
      }

      @Override
      public ListValue build() {
        ListValue result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @Override
      public ListValue buildPartial() {
        ListValue result = new ListValue(this);
        int from_bitField0_ = bitField0_;
        if (((bitField0_ & 0x00000001) != 0)) {
          s_ = java.util.Collections.unmodifiableList(s_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.s_ = s_;
        if (((bitField0_ & 0x00000002) != 0)) {
          i_.makeImmutable();
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.i_ = i_;
        if (((bitField0_ & 0x00000004) != 0)) {
          f_.makeImmutable();
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.f_ = f_;
        if (((bitField0_ & 0x00000008) != 0)) {
          b_.makeImmutable();
          bitField0_ = (bitField0_ & ~0x00000008);
        }
        result.b_ = b_;
        if (((bitField0_ & 0x00000010) != 0)) {
          type_ = java.util.Collections.unmodifiableList(type_);
          bitField0_ = (bitField0_ & ~0x00000010);
        }
        result.type_ = type_;
        if (shapeBuilder_ == null) {
          if (((bitField0_ & 0x00000020) != 0)) {
            shape_ = java.util.Collections.unmodifiableList(shape_);
            bitField0_ = (bitField0_ & ~0x00000020);
          }
          result.shape_ = shape_;
        } else {
          result.shape_ = shapeBuilder_.build();
        }
        if (tensorBuilder_ == null) {
          if (((bitField0_ & 0x00000040) != 0)) {
            tensor_ = java.util.Collections.unmodifiableList(tensor_);
            bitField0_ = (bitField0_ & ~0x00000040);
          }
          result.tensor_ = tensor_;
        } else {
          result.tensor_ = tensorBuilder_.build();
        }
        if (funcBuilder_ == null) {
          if (((bitField0_ & 0x00000080) != 0)) {
            func_ = java.util.Collections.unmodifiableList(func_);
            bitField0_ = (bitField0_ & ~0x00000080);
          }
          result.func_ = func_;
        } else {
          result.func_ = funcBuilder_.build();
        }
        onBuilt();
        return result;
      }

      @Override
      public Builder clone() {
        return super.clone();
      }

      @Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return super.setField(field, value);
      }

      @Override
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @Override
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return super.addRepeatedField(field, value);
      }

      @Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof ListValue) {
          return mergeFrom((ListValue) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(ListValue other) {
        if (other == ListValue.getDefaultInstance()) {
          return this;
        }
        if (!other.s_.isEmpty()) {
          if (s_.isEmpty()) {
            s_ = other.s_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureSIsMutable();
            s_.addAll(other.s_);
          }
          onChanged();
        }
        if (!other.i_.isEmpty()) {
          if (i_.isEmpty()) {
            i_ = other.i_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureIIsMutable();
            i_.addAll(other.i_);
          }
          onChanged();
        }
        if (!other.f_.isEmpty()) {
          if (f_.isEmpty()) {
            f_ = other.f_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureFIsMutable();
            f_.addAll(other.f_);
          }
          onChanged();
        }
        if (!other.b_.isEmpty()) {
          if (b_.isEmpty()) {
            b_ = other.b_;
            bitField0_ = (bitField0_ & ~0x00000008);
          } else {
            ensureBIsMutable();
            b_.addAll(other.b_);
          }
          onChanged();
        }
        if (!other.type_.isEmpty()) {
          if (type_.isEmpty()) {
            type_ = other.type_;
            bitField0_ = (bitField0_ & ~0x00000010);
          } else {
            ensureTypeIsMutable();
            type_.addAll(other.type_);
          }
          onChanged();
        }
        if (shapeBuilder_ == null) {
          if (!other.shape_.isEmpty()) {
            if (shape_.isEmpty()) {
              shape_ = other.shape_;
              bitField0_ = (bitField0_ & ~0x00000020);
            } else {
              ensureShapeIsMutable();
              shape_.addAll(other.shape_);
            }
            onChanged();
          }
        } else {
          if (!other.shape_.isEmpty()) {
            if (shapeBuilder_.isEmpty()) {
              shapeBuilder_.dispose();
              shapeBuilder_ = null;
              shape_ = other.shape_;
              bitField0_ = (bitField0_ & ~0x00000020);
              shapeBuilder_ =
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                      getShapeFieldBuilder() : null;
            } else {
              shapeBuilder_.addAllMessages(other.shape_);
            }
          }
        }
        if (tensorBuilder_ == null) {
          if (!other.tensor_.isEmpty()) {
            if (tensor_.isEmpty()) {
              tensor_ = other.tensor_;
              bitField0_ = (bitField0_ & ~0x00000040);
            } else {
              ensureTensorIsMutable();
              tensor_.addAll(other.tensor_);
            }
            onChanged();
          }
        } else {
          if (!other.tensor_.isEmpty()) {
            if (tensorBuilder_.isEmpty()) {
              tensorBuilder_.dispose();
              tensorBuilder_ = null;
              tensor_ = other.tensor_;
              bitField0_ = (bitField0_ & ~0x00000040);
              tensorBuilder_ =
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                      getTensorFieldBuilder() : null;
            } else {
              tensorBuilder_.addAllMessages(other.tensor_);
            }
          }
        }
        if (funcBuilder_ == null) {
          if (!other.func_.isEmpty()) {
            if (func_.isEmpty()) {
              func_ = other.func_;
              bitField0_ = (bitField0_ & ~0x00000080);
            } else {
              ensureFuncIsMutable();
              func_.addAll(other.func_);
            }
            onChanged();
          }
        } else {
          if (!other.func_.isEmpty()) {
            if (funcBuilder_.isEmpty()) {
              funcBuilder_.dispose();
              funcBuilder_ = null;
              func_ = other.func_;
              bitField0_ = (bitField0_ & ~0x00000080);
              funcBuilder_ =
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                      getFuncFieldBuilder() : null;
            } else {
              funcBuilder_.addAllMessages(other.func_);
            }
          }
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @Override
      public final boolean isInitialized() {
        return true;
      }

      @Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        ListValue parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (ListValue) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int bitField0_;

      private java.util.List<com.google.protobuf.ByteString> s_ = java.util.Collections.emptyList();

      private void ensureSIsMutable() {
        if (!((bitField0_ & 0x00000001) != 0)) {
          s_ = new java.util.ArrayList<com.google.protobuf.ByteString>(s_);
          bitField0_ |= 0x00000001;
        }
      }

      /**
       * <pre>
       * "list(string)"
       * </pre>
       *
       * <code>repeated bytes s = 2;</code>
       */
      public java.util.List<com.google.protobuf.ByteString>
      getSList() {
        return ((bitField0_ & 0x00000001) != 0) ?
            java.util.Collections.unmodifiableList(s_) : s_;
      }

      /**
       * <pre>
       * "list(string)"
       * </pre>
       *
       * <code>repeated bytes s = 2;</code>
       */
      public int getSCount() {
        return s_.size();
      }

      /**
       * <pre>
       * "list(string)"
       * </pre>
       *
       * <code>repeated bytes s = 2;</code>
       */
      public com.google.protobuf.ByteString getS(int index) {
        return s_.get(index);
      }

      /**
       * <pre>
       * "list(string)"
       * </pre>
       *
       * <code>repeated bytes s = 2;</code>
       */
      public Builder setS(
          int index, com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSIsMutable();
        s_.set(index, value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(string)"
       * </pre>
       *
       * <code>repeated bytes s = 2;</code>
       */
      public Builder addS(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSIsMutable();
        s_.add(value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(string)"
       * </pre>
       *
       * <code>repeated bytes s = 2;</code>
       */
      public Builder addAllS(
          Iterable<? extends com.google.protobuf.ByteString> values) {
        ensureSIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, s_);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(string)"
       * </pre>
       *
       * <code>repeated bytes s = 2;</code>
       */
      public Builder clearS() {
        s_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }

      private com.google.protobuf.Internal.LongList i_ = emptyLongList();

      private void ensureIIsMutable() {
        if (!((bitField0_ & 0x00000002) != 0)) {
          i_ = mutableCopy(i_);
          bitField0_ |= 0x00000002;
        }
      }

      /**
       * <pre>
       * "list(int)"
       * </pre>
       *
       * <code>repeated int64 i = 3 [packed = true];</code>
       */
      public java.util.List<Long>
      getIList() {
        return ((bitField0_ & 0x00000002) != 0) ?
            java.util.Collections.unmodifiableList(i_) : i_;
      }

      /**
       * <pre>
       * "list(int)"
       * </pre>
       *
       * <code>repeated int64 i = 3 [packed = true];</code>
       */
      public int getICount() {
        return i_.size();
      }

      /**
       * <pre>
       * "list(int)"
       * </pre>
       *
       * <code>repeated int64 i = 3 [packed = true];</code>
       */
      public long getI(int index) {
        return i_.getLong(index);
      }

      /**
       * <pre>
       * "list(int)"
       * </pre>
       *
       * <code>repeated int64 i = 3 [packed = true];</code>
       */
      public Builder setI(
          int index, long value) {
        ensureIIsMutable();
        i_.setLong(index, value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(int)"
       * </pre>
       *
       * <code>repeated int64 i = 3 [packed = true];</code>
       */
      public Builder addI(long value) {
        ensureIIsMutable();
        i_.addLong(value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(int)"
       * </pre>
       *
       * <code>repeated int64 i = 3 [packed = true];</code>
       */
      public Builder addAllI(
          Iterable<? extends Long> values) {
        ensureIIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, i_);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(int)"
       * </pre>
       *
       * <code>repeated int64 i = 3 [packed = true];</code>
       */
      public Builder clearI() {
        i_ = emptyLongList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }

      private com.google.protobuf.Internal.FloatList f_ = emptyFloatList();

      private void ensureFIsMutable() {
        if (!((bitField0_ & 0x00000004) != 0)) {
          f_ = mutableCopy(f_);
          bitField0_ |= 0x00000004;
        }
      }

      /**
       * <pre>
       * "list(float)"
       * </pre>
       *
       * <code>repeated float f = 4 [packed = true];</code>
       */
      public java.util.List<Float>
      getFList() {
        return ((bitField0_ & 0x00000004) != 0) ?
            java.util.Collections.unmodifiableList(f_) : f_;
      }

      /**
       * <pre>
       * "list(float)"
       * </pre>
       *
       * <code>repeated float f = 4 [packed = true];</code>
       */
      public int getFCount() {
        return f_.size();
      }

      /**
       * <pre>
       * "list(float)"
       * </pre>
       *
       * <code>repeated float f = 4 [packed = true];</code>
       */
      public float getF(int index) {
        return f_.getFloat(index);
      }

      /**
       * <pre>
       * "list(float)"
       * </pre>
       *
       * <code>repeated float f = 4 [packed = true];</code>
       */
      public Builder setF(
          int index, float value) {
        ensureFIsMutable();
        f_.setFloat(index, value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(float)"
       * </pre>
       *
       * <code>repeated float f = 4 [packed = true];</code>
       */
      public Builder addF(float value) {
        ensureFIsMutable();
        f_.addFloat(value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(float)"
       * </pre>
       *
       * <code>repeated float f = 4 [packed = true];</code>
       */
      public Builder addAllF(
          Iterable<? extends Float> values) {
        ensureFIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, f_);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(float)"
       * </pre>
       *
       * <code>repeated float f = 4 [packed = true];</code>
       */
      public Builder clearF() {
        f_ = emptyFloatList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
        return this;
      }

      private com.google.protobuf.Internal.BooleanList b_ = emptyBooleanList();

      private void ensureBIsMutable() {
        if (!((bitField0_ & 0x00000008) != 0)) {
          b_ = mutableCopy(b_);
          bitField0_ |= 0x00000008;
        }
      }

      /**
       * <pre>
       * "list(bool)"
       * </pre>
       *
       * <code>repeated bool b = 5 [packed = true];</code>
       */
      public java.util.List<Boolean>
      getBList() {
        return ((bitField0_ & 0x00000008) != 0) ?
            java.util.Collections.unmodifiableList(b_) : b_;
      }

      /**
       * <pre>
       * "list(bool)"
       * </pre>
       *
       * <code>repeated bool b = 5 [packed = true];</code>
       */
      public int getBCount() {
        return b_.size();
      }

      /**
       * <pre>
       * "list(bool)"
       * </pre>
       *
       * <code>repeated bool b = 5 [packed = true];</code>
       */
      public boolean getB(int index) {
        return b_.getBoolean(index);
      }

      /**
       * <pre>
       * "list(bool)"
       * </pre>
       *
       * <code>repeated bool b = 5 [packed = true];</code>
       */
      public Builder setB(
          int index, boolean value) {
        ensureBIsMutable();
        b_.setBoolean(index, value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(bool)"
       * </pre>
       *
       * <code>repeated bool b = 5 [packed = true];</code>
       */
      public Builder addB(boolean value) {
        ensureBIsMutable();
        b_.addBoolean(value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(bool)"
       * </pre>
       *
       * <code>repeated bool b = 5 [packed = true];</code>
       */
      public Builder addAllB(
          Iterable<? extends Boolean> values) {
        ensureBIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, b_);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(bool)"
       * </pre>
       *
       * <code>repeated bool b = 5 [packed = true];</code>
       */
      public Builder clearB() {
        b_ = emptyBooleanList();
        bitField0_ = (bitField0_ & ~0x00000008);
        onChanged();
        return this;
      }

      private java.util.List<Integer> type_ =
          java.util.Collections.emptyList();

      private void ensureTypeIsMutable() {
        if (!((bitField0_ & 0x00000010) != 0)) {
          type_ = new java.util.ArrayList<Integer>(type_);
          bitField0_ |= 0x00000010;
        }
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public java.util.List<DataType> getTypeList() {
        return new com.google.protobuf.Internal.ListAdapter<
            Integer, DataType>(type_, type_converter_);
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public int getTypeCount() {
        return type_.size();
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public DataType getType(int index) {
        return type_converter_.convert(type_.get(index));
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public Builder setType(
          int index, DataType value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTypeIsMutable();
        type_.set(index, value.getNumber());
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public Builder addType(DataType value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTypeIsMutable();
        type_.add(value.getNumber());
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public Builder addAllType(
          Iterable<? extends DataType> values) {
        ensureTypeIsMutable();
        for (DataType value : values) {
          type_.add(value.getNumber());
        }
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public Builder clearType() {
        type_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000010);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public java.util.List<Integer>
      getTypeValueList() {
        return java.util.Collections.unmodifiableList(type_);
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public int getTypeValue(int index) {
        return type_.get(index);
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public Builder setTypeValue(
          int index, int value) {
        ensureTypeIsMutable();
        type_.set(index, value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public Builder addTypeValue(int value) {
        ensureTypeIsMutable();
        type_.add(value);
        onChanged();
        return this;
      }

      /**
       * <pre>
       * "list(type)"
       * </pre>
       *
       * <code>repeated .tensorflow.DataType type = 6 [packed = true];</code>
       */
      public Builder addAllTypeValue(
          Iterable<Integer> values) {
        ensureTypeIsMutable();
        for (int value : values) {
          type_.add(value);
        }
        onChanged();
        return this;
      }

      private java.util.List<TensorShapeProto> shape_ =
          java.util.Collections.emptyList();

      private void ensureShapeIsMutable() {
        if (!((bitField0_ & 0x00000020) != 0)) {
          shape_ = new java.util.ArrayList<TensorShapeProto>(shape_);
          bitField0_ |= 0x00000020;
        }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> shapeBuilder_;

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public java.util.List<TensorShapeProto> getShapeList() {
        if (shapeBuilder_ == null) {
          return java.util.Collections.unmodifiableList(shape_);
        } else {
          return shapeBuilder_.getMessageList();
        }
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public int getShapeCount() {
        if (shapeBuilder_ == null) {
          return shape_.size();
        } else {
          return shapeBuilder_.getCount();
        }
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public TensorShapeProto getShape(int index) {
        if (shapeBuilder_ == null) {
          return shape_.get(index);
        } else {
          return shapeBuilder_.getMessage(index);
        }
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public Builder setShape(
          int index, TensorShapeProto value) {
        if (shapeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureShapeIsMutable();
          shape_.set(index, value);
          onChanged();
        } else {
          shapeBuilder_.setMessage(index, value);
        }
        return this;
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public Builder setShape(
          int index, TensorShapeProto.Builder builderForValue) {
        if (shapeBuilder_ == null) {
          ensureShapeIsMutable();
          shape_.set(index, builderForValue.build());
          onChanged();
        } else {
          shapeBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public Builder addShape(TensorShapeProto value) {
        if (shapeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureShapeIsMutable();
          shape_.add(value);
          onChanged();
        } else {
          shapeBuilder_.addMessage(value);
        }
        return this;
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public Builder addShape(
          int index, TensorShapeProto value) {
        if (shapeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureShapeIsMutable();
          shape_.add(index, value);
          onChanged();
        } else {
          shapeBuilder_.addMessage(index, value);
        }
        return this;
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public Builder addShape(
          TensorShapeProto.Builder builderForValue) {
        if (shapeBuilder_ == null) {
          ensureShapeIsMutable();
          shape_.add(builderForValue.build());
          onChanged();
        } else {
          shapeBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public Builder addShape(
          int index, TensorShapeProto.Builder builderForValue) {
        if (shapeBuilder_ == null) {
          ensureShapeIsMutable();
          shape_.add(index, builderForValue.build());
          onChanged();
        } else {
          shapeBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public Builder addAllShape(
          Iterable<? extends TensorShapeProto> values) {
        if (shapeBuilder_ == null) {
          ensureShapeIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, shape_);
          onChanged();
        } else {
          shapeBuilder_.addAllMessages(values);
        }
        return this;
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public Builder clearShape() {
        if (shapeBuilder_ == null) {
          shape_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000020);
          onChanged();
        } else {
          shapeBuilder_.clear();
        }
        return this;
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public Builder removeShape(int index) {
        if (shapeBuilder_ == null) {
          ensureShapeIsMutable();
          shape_.remove(index);
          onChanged();
        } else {
          shapeBuilder_.remove(index);
        }
        return this;
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public TensorShapeProto.Builder getShapeBuilder(
          int index) {
        return getShapeFieldBuilder().getBuilder(index);
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public TensorShapeProtoOrBuilder getShapeOrBuilder(
          int index) {
        if (shapeBuilder_ == null) {
          return shape_.get(index);
        } else {
          return shapeBuilder_.getMessageOrBuilder(index);
        }
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public java.util.List<? extends TensorShapeProtoOrBuilder>
      getShapeOrBuilderList() {
        if (shapeBuilder_ != null) {
          return shapeBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(shape_);
        }
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public TensorShapeProto.Builder addShapeBuilder() {
        return getShapeFieldBuilder().addBuilder(
            TensorShapeProto.getDefaultInstance());
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public TensorShapeProto.Builder addShapeBuilder(
          int index) {
        return getShapeFieldBuilder().addBuilder(
            index, TensorShapeProto.getDefaultInstance());
      }

      /**
       * <pre>
       * "list(shape)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorShapeProto shape = 7;</code>
       */
      public java.util.List<TensorShapeProto.Builder>
      getShapeBuilderList() {
        return getShapeFieldBuilder().getBuilderList();
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder>
      getShapeFieldBuilder() {
        if (shapeBuilder_ == null) {
          shapeBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
              TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder>(
              shape_,
              ((bitField0_ & 0x00000020) != 0),
              getParentForChildren(),
              isClean());
          shape_ = null;
        }
        return shapeBuilder_;
      }

      private java.util.List<TensorProto> tensor_ =
          java.util.Collections.emptyList();

      private void ensureTensorIsMutable() {
        if (!((bitField0_ & 0x00000040) != 0)) {
          tensor_ = new java.util.ArrayList<TensorProto>(tensor_);
          bitField0_ |= 0x00000040;
        }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          TensorProto, TensorProto.Builder, TensorProtoOrBuilder> tensorBuilder_;

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public java.util.List<TensorProto> getTensorList() {
        if (tensorBuilder_ == null) {
          return java.util.Collections.unmodifiableList(tensor_);
        } else {
          return tensorBuilder_.getMessageList();
        }
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public int getTensorCount() {
        if (tensorBuilder_ == null) {
          return tensor_.size();
        } else {
          return tensorBuilder_.getCount();
        }
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public TensorProto getTensor(int index) {
        if (tensorBuilder_ == null) {
          return tensor_.get(index);
        } else {
          return tensorBuilder_.getMessage(index);
        }
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public Builder setTensor(
          int index, TensorProto value) {
        if (tensorBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTensorIsMutable();
          tensor_.set(index, value);
          onChanged();
        } else {
          tensorBuilder_.setMessage(index, value);
        }
        return this;
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public Builder setTensor(
          int index, TensorProto.Builder builderForValue) {
        if (tensorBuilder_ == null) {
          ensureTensorIsMutable();
          tensor_.set(index, builderForValue.build());
          onChanged();
        } else {
          tensorBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public Builder addTensor(TensorProto value) {
        if (tensorBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTensorIsMutable();
          tensor_.add(value);
          onChanged();
        } else {
          tensorBuilder_.addMessage(value);
        }
        return this;
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public Builder addTensor(
          int index, TensorProto value) {
        if (tensorBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTensorIsMutable();
          tensor_.add(index, value);
          onChanged();
        } else {
          tensorBuilder_.addMessage(index, value);
        }
        return this;
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public Builder addTensor(
          TensorProto.Builder builderForValue) {
        if (tensorBuilder_ == null) {
          ensureTensorIsMutable();
          tensor_.add(builderForValue.build());
          onChanged();
        } else {
          tensorBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public Builder addTensor(
          int index, TensorProto.Builder builderForValue) {
        if (tensorBuilder_ == null) {
          ensureTensorIsMutable();
          tensor_.add(index, builderForValue.build());
          onChanged();
        } else {
          tensorBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public Builder addAllTensor(
          Iterable<? extends TensorProto> values) {
        if (tensorBuilder_ == null) {
          ensureTensorIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, tensor_);
          onChanged();
        } else {
          tensorBuilder_.addAllMessages(values);
        }
        return this;
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public Builder clearTensor() {
        if (tensorBuilder_ == null) {
          tensor_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000040);
          onChanged();
        } else {
          tensorBuilder_.clear();
        }
        return this;
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public Builder removeTensor(int index) {
        if (tensorBuilder_ == null) {
          ensureTensorIsMutable();
          tensor_.remove(index);
          onChanged();
        } else {
          tensorBuilder_.remove(index);
        }
        return this;
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public TensorProto.Builder getTensorBuilder(
          int index) {
        return getTensorFieldBuilder().getBuilder(index);
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public TensorProtoOrBuilder getTensorOrBuilder(
          int index) {
        if (tensorBuilder_ == null) {
          return tensor_.get(index);
        } else {
          return tensorBuilder_.getMessageOrBuilder(index);
        }
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public java.util.List<? extends TensorProtoOrBuilder>
      getTensorOrBuilderList() {
        if (tensorBuilder_ != null) {
          return tensorBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(tensor_);
        }
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public TensorProto.Builder addTensorBuilder() {
        return getTensorFieldBuilder().addBuilder(
            TensorProto.getDefaultInstance());
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public TensorProto.Builder addTensorBuilder(
          int index) {
        return getTensorFieldBuilder().addBuilder(
            index, TensorProto.getDefaultInstance());
      }

      /**
       * <pre>
       * "list(tensor)"
       * </pre>
       *
       * <code>repeated .tensorflow.TensorProto tensor = 8;</code>
       */
      public java.util.List<TensorProto.Builder>
      getTensorBuilderList() {
        return getTensorFieldBuilder().getBuilderList();
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          TensorProto, TensorProto.Builder, TensorProtoOrBuilder>
      getTensorFieldBuilder() {
        if (tensorBuilder_ == null) {
          tensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
              TensorProto, TensorProto.Builder, TensorProtoOrBuilder>(
              tensor_,
              ((bitField0_ & 0x00000040) != 0),
              getParentForChildren(),
              isClean());
          tensor_ = null;
        }
        return tensorBuilder_;
      }

      private java.util.List<NameAttrList> func_ =
          java.util.Collections.emptyList();

      private void ensureFuncIsMutable() {
        if (!((bitField0_ & 0x00000080) != 0)) {
          func_ = new java.util.ArrayList<NameAttrList>(func_);
          bitField0_ |= 0x00000080;
        }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder> funcBuilder_;

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public java.util.List<NameAttrList> getFuncList() {
        if (funcBuilder_ == null) {
          return java.util.Collections.unmodifiableList(func_);
        } else {
          return funcBuilder_.getMessageList();
        }
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public int getFuncCount() {
        if (funcBuilder_ == null) {
          return func_.size();
        } else {
          return funcBuilder_.getCount();
        }
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public NameAttrList getFunc(int index) {
        if (funcBuilder_ == null) {
          return func_.get(index);
        } else {
          return funcBuilder_.getMessage(index);
        }
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public Builder setFunc(
          int index, NameAttrList value) {
        if (funcBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureFuncIsMutable();
          func_.set(index, value);
          onChanged();
        } else {
          funcBuilder_.setMessage(index, value);
        }
        return this;
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public Builder setFunc(
          int index, NameAttrList.Builder builderForValue) {
        if (funcBuilder_ == null) {
          ensureFuncIsMutable();
          func_.set(index, builderForValue.build());
          onChanged();
        } else {
          funcBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public Builder addFunc(NameAttrList value) {
        if (funcBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureFuncIsMutable();
          func_.add(value);
          onChanged();
        } else {
          funcBuilder_.addMessage(value);
        }
        return this;
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public Builder addFunc(
          int index, NameAttrList value) {
        if (funcBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureFuncIsMutable();
          func_.add(index, value);
          onChanged();
        } else {
          funcBuilder_.addMessage(index, value);
        }
        return this;
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public Builder addFunc(
          NameAttrList.Builder builderForValue) {
        if (funcBuilder_ == null) {
          ensureFuncIsMutable();
          func_.add(builderForValue.build());
          onChanged();
        } else {
          funcBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public Builder addFunc(
          int index, NameAttrList.Builder builderForValue) {
        if (funcBuilder_ == null) {
          ensureFuncIsMutable();
          func_.add(index, builderForValue.build());
          onChanged();
        } else {
          funcBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public Builder addAllFunc(
          Iterable<? extends NameAttrList> values) {
        if (funcBuilder_ == null) {
          ensureFuncIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, func_);
          onChanged();
        } else {
          funcBuilder_.addAllMessages(values);
        }
        return this;
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public Builder clearFunc() {
        if (funcBuilder_ == null) {
          func_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000080);
          onChanged();
        } else {
          funcBuilder_.clear();
        }
        return this;
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public Builder removeFunc(int index) {
        if (funcBuilder_ == null) {
          ensureFuncIsMutable();
          func_.remove(index);
          onChanged();
        } else {
          funcBuilder_.remove(index);
        }
        return this;
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public NameAttrList.Builder getFuncBuilder(
          int index) {
        return getFuncFieldBuilder().getBuilder(index);
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public NameAttrListOrBuilder getFuncOrBuilder(
          int index) {
        if (funcBuilder_ == null) {
          return func_.get(index);
        } else {
          return funcBuilder_.getMessageOrBuilder(index);
        }
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public java.util.List<? extends NameAttrListOrBuilder>
      getFuncOrBuilderList() {
        if (funcBuilder_ != null) {
          return funcBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(func_);
        }
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public NameAttrList.Builder addFuncBuilder() {
        return getFuncFieldBuilder().addBuilder(
            NameAttrList.getDefaultInstance());
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public NameAttrList.Builder addFuncBuilder(
          int index) {
        return getFuncFieldBuilder().addBuilder(
            index, NameAttrList.getDefaultInstance());
      }

      /**
       * <pre>
       * "list(attr)"
       * </pre>
       *
       * <code>repeated .tensorflow.NameAttrList func = 9;</code>
       */
      public java.util.List<NameAttrList.Builder>
      getFuncBuilderList() {
        return getFuncFieldBuilder().getBuilderList();
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder>
      getFuncFieldBuilder() {
        if (funcBuilder_ == null) {
          funcBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
              NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder>(
              func_,
              ((bitField0_ & 0x00000080) != 0),
              getParentForChildren(),
              isClean());
          func_ = null;
        }
        return funcBuilder_;
      }

      @Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:tensorflow.AttrValue.ListValue)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.AttrValue.ListValue)
    private static final ListValue DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new ListValue();
    }

    public static ListValue getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ListValue>
        PARSER = new com.google.protobuf.AbstractParser<ListValue>() {
      @Override
      public ListValue parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new ListValue(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<ListValue> parser() {
      return PARSER;
    }

    @Override
    public com.google.protobuf.Parser<ListValue> getParserForType() {
      return PARSER;
    }

    @Override
    public ListValue getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private int valueCase_ = 0;
  private Object value_;

  public enum ValueCase
      implements com.google.protobuf.Internal.EnumLite {
    S(2),
    I(3),
    F(4),
    B(5),
    TYPE(6),
    SHAPE(7),
    TENSOR(8),
    LIST(1),
    FUNC(10),
    PLACEHOLDER(9),
    VALUE_NOT_SET(0);
    private final int value;

    private ValueCase(int value) {
      this.value = value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @Deprecated
    public static ValueCase valueOf(int value) {
      return forNumber(value);
    }

    public static ValueCase forNumber(int value) {
      switch (value) {
        case 2: return S;
        case 3: return I;
        case 4: return F;
        case 5: return B;
        case 6: return TYPE;
        case 7: return SHAPE;
        case 8: return TENSOR;
        case 1: return LIST;
        case 10: return FUNC;
        case 9: return PLACEHOLDER;
        case 0: return VALUE_NOT_SET;
        default: return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public ValueCase
  getValueCase() {
    return ValueCase.forNumber(
        valueCase_);
  }

  public static final int S_FIELD_NUMBER = 2;

  /**
   * <pre>
   * "string"
   * </pre>
   *
   * <code>bytes s = 2;</code>
   */
  public com.google.protobuf.ByteString getS() {
    if (valueCase_ == 2) {
      return (com.google.protobuf.ByteString) value_;
    }
    return com.google.protobuf.ByteString.EMPTY;
  }

  public static final int I_FIELD_NUMBER = 3;

  /**
   * <pre>
   * "int"
   * </pre>
   *
   * <code>int64 i = 3;</code>
   */
  public long getI() {
    if (valueCase_ == 3) {
      return (Long) value_;
    }
    return 0L;
  }

  public static final int F_FIELD_NUMBER = 4;

  /**
   * <pre>
   * "float"
   * </pre>
   *
   * <code>float f = 4;</code>
   */
  public float getF() {
    if (valueCase_ == 4) {
      return (Float) value_;
    }
    return 0F;
  }

  public static final int B_FIELD_NUMBER = 5;

  /**
   * <pre>
   * "bool"
   * </pre>
   *
   * <code>bool b = 5;</code>
   */
  public boolean getB() {
    if (valueCase_ == 5) {
      return (Boolean) value_;
    }
    return false;
  }

  public static final int TYPE_FIELD_NUMBER = 6;

  /**
   * <pre>
   * "type"
   * </pre>
   *
   * <code>.tensorflow.DataType type = 6;</code>
   */
  public int getTypeValue() {
    if (valueCase_ == 6) {
      return (Integer) value_;
    }
    return 0;
  }

  /**
   * <pre>
   * "type"
   * </pre>
   *
   * <code>.tensorflow.DataType type = 6;</code>
   */
  public DataType getType() {
    if (valueCase_ == 6) {
      @SuppressWarnings("deprecation")
      DataType result = DataType.valueOf(
          (Integer) value_);
      return result == null ? DataType.UNRECOGNIZED : result;
    }
    return DataType.DT_INVALID;
  }

  public static final int SHAPE_FIELD_NUMBER = 7;

  /**
   * <pre>
   * "shape"
   * </pre>
   *
   * <code>.tensorflow.TensorShapeProto shape = 7;</code>
   */
  public boolean hasShape() {
    return valueCase_ == 7;
  }

  /**
   * <pre>
   * "shape"
   * </pre>
   *
   * <code>.tensorflow.TensorShapeProto shape = 7;</code>
   */
  public TensorShapeProto getShape() {
    if (valueCase_ == 7) {
      return (TensorShapeProto) value_;
    }
    return TensorShapeProto.getDefaultInstance();
  }

  /**
   * <pre>
   * "shape"
   * </pre>
   *
   * <code>.tensorflow.TensorShapeProto shape = 7;</code>
   */
  public TensorShapeProtoOrBuilder getShapeOrBuilder() {
    if (valueCase_ == 7) {
      return (TensorShapeProto) value_;
    }
    return TensorShapeProto.getDefaultInstance();
  }

  public static final int TENSOR_FIELD_NUMBER = 8;

  /**
   * <pre>
   * "tensor"
   * </pre>
   *
   * <code>.tensorflow.TensorProto tensor = 8;</code>
   */
  public boolean hasTensor() {
    return valueCase_ == 8;
  }

  /**
   * <pre>
   * "tensor"
   * </pre>
   *
   * <code>.tensorflow.TensorProto tensor = 8;</code>
   */
  public TensorProto getTensor() {
    if (valueCase_ == 8) {
      return (TensorProto) value_;
    }
    return TensorProto.getDefaultInstance();
  }

  /**
   * <pre>
   * "tensor"
   * </pre>
   *
   * <code>.tensorflow.TensorProto tensor = 8;</code>
   */
  public TensorProtoOrBuilder getTensorOrBuilder() {
    if (valueCase_ == 8) {
      return (TensorProto) value_;
    }
    return TensorProto.getDefaultInstance();
  }

  public static final int LIST_FIELD_NUMBER = 1;

  /**
   * <pre>
   * any "list(...)"
   * </pre>
   *
   * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
   */
  public boolean hasList() {
    return valueCase_ == 1;
  }

  /**
   * <pre>
   * any "list(...)"
   * </pre>
   *
   * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
   */
  public ListValue getList() {
    if (valueCase_ == 1) {
      return (ListValue) value_;
    }
    return ListValue.getDefaultInstance();
  }

  /**
   * <pre>
   * any "list(...)"
   * </pre>
   *
   * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
   */
  public ListValueOrBuilder getListOrBuilder() {
    if (valueCase_ == 1) {
      return (ListValue) value_;
    }
    return ListValue.getDefaultInstance();
  }

  public static final int FUNC_FIELD_NUMBER = 10;

  /**
   * <pre>
   * "func" represents a function. func.name is a function's name or
   * a primitive op's name. func.attr.first is the name of an attr
   * defined for that function. func.attr.second is the value for
   * that attr in the instantiation.
   * </pre>
   *
   * <code>.tensorflow.NameAttrList func = 10;</code>
   */
  public boolean hasFunc() {
    return valueCase_ == 10;
  }

  /**
   * <pre>
   * "func" represents a function. func.name is a function's name or
   * a primitive op's name. func.attr.first is the name of an attr
   * defined for that function. func.attr.second is the value for
   * that attr in the instantiation.
   * </pre>
   *
   * <code>.tensorflow.NameAttrList func = 10;</code>
   */
  public NameAttrList getFunc() {
    if (valueCase_ == 10) {
      return (NameAttrList) value_;
    }
    return NameAttrList.getDefaultInstance();
  }

  /**
   * <pre>
   * "func" represents a function. func.name is a function's name or
   * a primitive op's name. func.attr.first is the name of an attr
   * defined for that function. func.attr.second is the value for
   * that attr in the instantiation.
   * </pre>
   *
   * <code>.tensorflow.NameAttrList func = 10;</code>
   */
  public NameAttrListOrBuilder getFuncOrBuilder() {
    if (valueCase_ == 10) {
      return (NameAttrList) value_;
    }
    return NameAttrList.getDefaultInstance();
  }

  public static final int PLACEHOLDER_FIELD_NUMBER = 9;

  /**
   * <pre>
   * This is a placeholder only used in nodes defined inside a
   * function.  It indicates the attr value will be supplied when
   * the function is instantiated.  For example, let us suppose a
   * node "N" in function "FN". "N" has an attr "A" with value
   * placeholder = "foo". When FN is instantiated with attr "foo"
   * set to "bar", the instantiated node N's attr A will have been
   * given the value "bar".
   * </pre>
   *
   * <code>string placeholder = 9;</code>
   */
  public String getPlaceholder() {
    Object ref = "";
    if (valueCase_ == 9) {
      ref = value_;
    }
    if (ref instanceof String) {
      return (String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      String s = bs.toStringUtf8();
      if (valueCase_ == 9) {
        value_ = s;
      }
      return s;
    }
  }

  /**
   * <pre>
   * This is a placeholder only used in nodes defined inside a
   * function.  It indicates the attr value will be supplied when
   * the function is instantiated.  For example, let us suppose a
   * node "N" in function "FN". "N" has an attr "A" with value
   * placeholder = "foo". When FN is instantiated with attr "foo"
   * set to "bar", the instantiated node N's attr A will have been
   * given the value "bar".
   * </pre>
   *
   * <code>string placeholder = 9;</code>
   */
  public com.google.protobuf.ByteString
  getPlaceholderBytes() {
    Object ref = "";
    if (valueCase_ == 9) {
      ref = value_;
    }
    if (ref instanceof String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (String) ref);
      if (valueCase_ == 9) {
        value_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

  @Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
      throws java.io.IOException {
    if (valueCase_ == 1) {
      output.writeMessage(1, (ListValue) value_);
    }
    if (valueCase_ == 2) {
      output.writeBytes(
          2, (com.google.protobuf.ByteString) value_);
    }
    if (valueCase_ == 3) {
      output.writeInt64(
          3, (long) ((Long) value_));
    }
    if (valueCase_ == 4) {
      output.writeFloat(
          4, (float) ((Float) value_));
    }
    if (valueCase_ == 5) {
      output.writeBool(
          5, (boolean) ((Boolean) value_));
    }
    if (valueCase_ == 6) {
      output.writeEnum(6, ((Integer) value_));
    }
    if (valueCase_ == 7) {
      output.writeMessage(7, (TensorShapeProto) value_);
    }
    if (valueCase_ == 8) {
      output.writeMessage(8, (TensorProto) value_);
    }
    if (valueCase_ == 9) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 9, value_);
    }
    if (valueCase_ == 10) {
      output.writeMessage(10, (NameAttrList) value_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (valueCase_ == 1) {
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, (ListValue) value_);
    }
    if (valueCase_ == 2) {
      size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(
              2, (com.google.protobuf.ByteString) value_);
    }
    if (valueCase_ == 3) {
      size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(
              3, (long) ((Long) value_));
    }
    if (valueCase_ == 4) {
      size += com.google.protobuf.CodedOutputStream
          .computeFloatSize(
              4, (float) ((Float) value_));
    }
    if (valueCase_ == 5) {
      size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(
              5, (boolean) ((Boolean) value_));
    }
    if (valueCase_ == 6) {
      size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(6, ((Integer) value_));
    }
    if (valueCase_ == 7) {
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(7, (TensorShapeProto) value_);
    }
    if (valueCase_ == 8) {
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(8, (TensorProto) value_);
    }
    if (valueCase_ == 9) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, value_);
    }
    if (valueCase_ == 10) {
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(10, (NameAttrList) value_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @Override
  public boolean equals(final Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof AttrValue)) {
      return super.equals(obj);
    }
    AttrValue other = (AttrValue) obj;

    if (!getValueCase().equals(other.getValueCase())) {
      return false;
    }
    switch (valueCase_) {
      case 2:
        if (!getS()
            .equals(other.getS())) {
          return false;
        }
        break;
      case 3:
        if (getI()
            != other.getI()) {
          return false;
        }
        break;
      case 4:
        if (Float.floatToIntBits(getF())
            != Float.floatToIntBits(
            other.getF())) {
          return false;
        }
        break;
      case 5:
        if (getB()
            != other.getB()) {
          return false;
        }
        break;
      case 6:
        if (getTypeValue()
            != other.getTypeValue()) {
          return false;
        }
        break;
      case 7:
        if (!getShape()
            .equals(other.getShape())) return false;
        break;
      case 8:
        if (!getTensor()
            .equals(other.getTensor())) return false;
        break;
      case 1:
        if (!getList()
            .equals(other.getList())) return false;
        break;
      case 10:
        if (!getFunc()
            .equals(other.getFunc())) return false;
        break;
      case 9:
        if (!getPlaceholder()
            .equals(other.getPlaceholder())) return false;
        break;
      case 0:
      default:
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    switch (valueCase_) {
      case 2:
        hash = (37 * hash) + S_FIELD_NUMBER;
        hash = (53 * hash) + getS().hashCode();
        break;
      case 3:
        hash = (37 * hash) + I_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
            getI());
        break;
      case 4:
        hash = (37 * hash) + F_FIELD_NUMBER;
        hash = (53 * hash) + Float.floatToIntBits(
            getF());
        break;
      case 5:
        hash = (37 * hash) + B_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
            getB());
        break;
      case 6:
        hash = (37 * hash) + TYPE_FIELD_NUMBER;
        hash = (53 * hash) + getTypeValue();
        break;
      case 7:
        hash = (37 * hash) + SHAPE_FIELD_NUMBER;
        hash = (53 * hash) + getShape().hashCode();
        break;
      case 8:
        hash = (37 * hash) + TENSOR_FIELD_NUMBER;
        hash = (53 * hash) + getTensor().hashCode();
        break;
      case 1:
        hash = (37 * hash) + LIST_FIELD_NUMBER;
        hash = (53 * hash) + getList().hashCode();
        break;
      case 10:
        hash = (37 * hash) + FUNC_FIELD_NUMBER;
        hash = (53 * hash) + getFunc().hashCode();
        break;
      case 9:
        hash = (37 * hash) + PLACEHOLDER_FIELD_NUMBER;
        hash = (53 * hash) + getPlaceholder().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static AttrValue parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static AttrValue parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static AttrValue parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static AttrValue parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static AttrValue parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static AttrValue parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static AttrValue parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }

  public static AttrValue parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public static AttrValue parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }

  public static AttrValue parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }

  public static AttrValue parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }

  public static AttrValue parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @Override
  public Builder newBuilderForType() { return newBuilder(); }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(AttrValue prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @Override
  protected Builder newBuilderForType(
      BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }

  /**
   * <pre>
   * Protocol buffer representing the value for an attr used to configure an Op.
   * Comment indicates the corresponding attr type.  Only the field matching the
   * attr type may be filled.
   * </pre>
   *
   * Protobuf type {@code tensorflow.AttrValue}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.AttrValue)
      AttrValueOrBuilder {

    public static final com.google.protobuf.Descriptors.Descriptor
    getDescriptor() {
      return AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor;
    }

    @Override
    protected FieldAccessorTable
    internalGetFieldAccessorTable() {
      return AttrValueProtos.internal_static_tensorflow_AttrValue_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              AttrValue.class, Builder.class);
    }

    // Construct using org.tensorflow.proto.framework.AttrValue.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
          .alwaysUseFieldBuilders) {
      }
    }

    @Override
    public Builder clear() {
      super.clear();
      valueCase_ = 0;
      value_ = null;
      return this;
    }

    @Override
    public com.google.protobuf.Descriptors.Descriptor
    getDescriptorForType() {
      return AttrValueProtos.internal_static_tensorflow_AttrValue_descriptor;
    }

    @Override
    public AttrValue getDefaultInstanceForType() {
      return AttrValue.getDefaultInstance();
    }

    @Override
    public AttrValue build() {
      AttrValue result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @Override
    public AttrValue buildPartial() {
      AttrValue result = new AttrValue(this);
      if (valueCase_ == 2) {
        result.value_ = value_;
      }
      if (valueCase_ == 3) {
        result.value_ = value_;
      }
      if (valueCase_ == 4) {
        result.value_ = value_;
      }
      if (valueCase_ == 5) {
        result.value_ = value_;
      }
      if (valueCase_ == 6) {
        result.value_ = value_;
      }
      if (valueCase_ == 7) {
        if (shapeBuilder_ == null) {
          result.value_ = value_;
        } else {
          result.value_ = shapeBuilder_.build();
        }
      }
      if (valueCase_ == 8) {
        if (tensorBuilder_ == null) {
          result.value_ = value_;
        } else {
          result.value_ = tensorBuilder_.build();
        }
      }
      if (valueCase_ == 1) {
        if (listBuilder_ == null) {
          result.value_ = value_;
        } else {
          result.value_ = listBuilder_.build();
        }
      }
      if (valueCase_ == 10) {
        if (funcBuilder_ == null) {
          result.value_ = value_;
        } else {
          result.value_ = funcBuilder_.build();
        }
      }
      if (valueCase_ == 9) {
        result.value_ = value_;
      }
      result.valueCase_ = valueCase_;
      onBuilt();
      return result;
    }

    @Override
    public Builder clone() {
      return super.clone();
    }

    @Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return super.setField(field, value);
    }

    @Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return super.addRepeatedField(field, value);
    }

    @Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof AttrValue) {
        return mergeFrom((AttrValue) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(AttrValue other) {
      if (other == AttrValue.getDefaultInstance()) {
        return this;
      }
      switch (other.getValueCase()) {
        case S: {
          setS(other.getS());
          break;
        }
        case I: {
          setI(other.getI());
          break;
        }
        case F: {
          setF(other.getF());
          break;
        }
        case B: {
          setB(other.getB());
          break;
        }
        case TYPE: {
          setTypeValue(other.getTypeValue());
          break;
        }
        case SHAPE: {
          mergeShape(other.getShape());
          break;
        }
        case TENSOR: {
          mergeTensor(other.getTensor());
          break;
        }
        case LIST: {
          mergeList(other.getList());
          break;
        }
        case FUNC: {
          mergeFunc(other.getFunc());
          break;
        }
        case PLACEHOLDER: {
          valueCase_ = 9;
          value_ = other.value_;
          onChanged();
          break;
        }
        case VALUE_NOT_SET: {
          break;
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @Override
    public final boolean isInitialized() {
      return true;
    }

    @Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      AttrValue parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (AttrValue) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int valueCase_ = 0;
    private Object value_;

    public ValueCase
    getValueCase() {
      return ValueCase.forNumber(
          valueCase_);
    }

    public Builder clearValue() {
      valueCase_ = 0;
      value_ = null;
      onChanged();
      return this;
    }


    /**
     * <pre>
     * "string"
     * </pre>
     *
     * <code>bytes s = 2;</code>
     */
    public com.google.protobuf.ByteString getS() {
      if (valueCase_ == 2) {
        return (com.google.protobuf.ByteString) value_;
      }
      return com.google.protobuf.ByteString.EMPTY;
    }

    /**
     * <pre>
     * "string"
     * </pre>
     *
     * <code>bytes s = 2;</code>
     */
    public Builder setS(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      valueCase_ = 2;
      value_ = value;
      onChanged();
      return this;
    }

    /**
     * <pre>
     * "string"
     * </pre>
     *
     * <code>bytes s = 2;</code>
     */
    public Builder clearS() {
      if (valueCase_ == 2) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <pre>
     * "int"
     * </pre>
     *
     * <code>int64 i = 3;</code>
     */
    public long getI() {
      if (valueCase_ == 3) {
        return (Long) value_;
      }
      return 0L;
    }

    /**
     * <pre>
     * "int"
     * </pre>
     *
     * <code>int64 i = 3;</code>
     */
    public Builder setI(long value) {
      valueCase_ = 3;
      value_ = value;
      onChanged();
      return this;
    }

    /**
     * <pre>
     * "int"
     * </pre>
     *
     * <code>int64 i = 3;</code>
     */
    public Builder clearI() {
      if (valueCase_ == 3) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <pre>
     * "float"
     * </pre>
     *
     * <code>float f = 4;</code>
     */
    public float getF() {
      if (valueCase_ == 4) {
        return (Float) value_;
      }
      return 0F;
    }

    /**
     * <pre>
     * "float"
     * </pre>
     *
     * <code>float f = 4;</code>
     */
    public Builder setF(float value) {
      valueCase_ = 4;
      value_ = value;
      onChanged();
      return this;
    }

    /**
     * <pre>
     * "float"
     * </pre>
     *
     * <code>float f = 4;</code>
     */
    public Builder clearF() {
      if (valueCase_ == 4) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <pre>
     * "bool"
     * </pre>
     *
     * <code>bool b = 5;</code>
     */
    public boolean getB() {
      if (valueCase_ == 5) {
        return (Boolean) value_;
      }
      return false;
    }

    /**
     * <pre>
     * "bool"
     * </pre>
     *
     * <code>bool b = 5;</code>
     */
    public Builder setB(boolean value) {
      valueCase_ = 5;
      value_ = value;
      onChanged();
      return this;
    }

    /**
     * <pre>
     * "bool"
     * </pre>
     *
     * <code>bool b = 5;</code>
     */
    public Builder clearB() {
      if (valueCase_ == 5) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <pre>
     * "type"
     * </pre>
     *
     * <code>.tensorflow.DataType type = 6;</code>
     */
    public int getTypeValue() {
      if (valueCase_ == 6) {
        return ((Integer) value_).intValue();
      }
      return 0;
    }

    /**
     * <pre>
     * "type"
     * </pre>
     *
     * <code>.tensorflow.DataType type = 6;</code>
     */
    public Builder setTypeValue(int value) {
      valueCase_ = 6;
      value_ = value;
      onChanged();
      return this;
    }

    /**
     * <pre>
     * "type"
     * </pre>
     *
     * <code>.tensorflow.DataType type = 6;</code>
     */
    public DataType getType() {
      if (valueCase_ == 6) {
        @SuppressWarnings("deprecation")
        DataType result = DataType.valueOf(
            (Integer) value_);
        return result == null ? DataType.UNRECOGNIZED : result;
      }
      return DataType.DT_INVALID;
    }

    /**
     * <pre>
     * "type"
     * </pre>
     *
     * <code>.tensorflow.DataType type = 6;</code>
     */
    public Builder setType(DataType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      valueCase_ = 6;
      value_ = value.getNumber();
      onChanged();
      return this;
    }

    /**
     * <pre>
     * "type"
     * </pre>
     *
     * <code>.tensorflow.DataType type = 6;</code>
     */
    public Builder clearType() {
      if (valueCase_ == 6) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder> shapeBuilder_;

    /**
     * <pre>
     * "shape"
     * </pre>
     *
     * <code>.tensorflow.TensorShapeProto shape = 7;</code>
     */
    public boolean hasShape() {
      return valueCase_ == 7;
    }

    /**
     * <pre>
     * "shape"
     * </pre>
     *
     * <code>.tensorflow.TensorShapeProto shape = 7;</code>
     */
    public TensorShapeProto getShape() {
      if (shapeBuilder_ == null) {
        if (valueCase_ == 7) {
          return (TensorShapeProto) value_;
        }
        return TensorShapeProto.getDefaultInstance();
      } else {
        if (valueCase_ == 7) {
          return shapeBuilder_.getMessage();
        }
        return TensorShapeProto.getDefaultInstance();
      }
    }

    /**
     * <pre>
     * "shape"
     * </pre>
     *
     * <code>.tensorflow.TensorShapeProto shape = 7;</code>
     */
    public Builder setShape(TensorShapeProto value) {
      if (shapeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        value_ = value;
        onChanged();
      } else {
        shapeBuilder_.setMessage(value);
      }
      valueCase_ = 7;
      return this;
    }

    /**
     * <pre>
     * "shape"
     * </pre>
     *
     * <code>.tensorflow.TensorShapeProto shape = 7;</code>
     */
    public Builder setShape(
        TensorShapeProto.Builder builderForValue) {
      if (shapeBuilder_ == null) {
        value_ = builderForValue.build();
        onChanged();
      } else {
        shapeBuilder_.setMessage(builderForValue.build());
      }
      valueCase_ = 7;
      return this;
    }

    /**
     * <pre>
     * "shape"
     * </pre>
     *
     * <code>.tensorflow.TensorShapeProto shape = 7;</code>
     */
    public Builder mergeShape(TensorShapeProto value) {
      if (shapeBuilder_ == null) {
        if (valueCase_ == 7 &&
            value_ != TensorShapeProto.getDefaultInstance()) {
          value_ = TensorShapeProto.newBuilder((TensorShapeProto) value_)
              .mergeFrom(value).buildPartial();
        } else {
          value_ = value;
        }
        onChanged();
      } else {
        if (valueCase_ == 7) {
          shapeBuilder_.mergeFrom(value);
        }
        shapeBuilder_.setMessage(value);
      }
      valueCase_ = 7;
      return this;
    }

    /**
     * <pre>
     * "shape"
     * </pre>
     *
     * <code>.tensorflow.TensorShapeProto shape = 7;</code>
     */
    public Builder clearShape() {
      if (shapeBuilder_ == null) {
        if (valueCase_ == 7) {
          valueCase_ = 0;
          value_ = null;
          onChanged();
        }
      } else {
        if (valueCase_ == 7) {
          valueCase_ = 0;
          value_ = null;
        }
        shapeBuilder_.clear();
      }
      return this;
    }

    /**
     * <pre>
     * "shape"
     * </pre>
     *
     * <code>.tensorflow.TensorShapeProto shape = 7;</code>
     */
    public TensorShapeProto.Builder getShapeBuilder() {
      return getShapeFieldBuilder().getBuilder();
    }

    /**
     * <pre>
     * "shape"
     * </pre>
     *
     * <code>.tensorflow.TensorShapeProto shape = 7;</code>
     */
    public TensorShapeProtoOrBuilder getShapeOrBuilder() {
      if ((valueCase_ == 7) && (shapeBuilder_ != null)) {
        return shapeBuilder_.getMessageOrBuilder();
      } else {
        if (valueCase_ == 7) {
          return (TensorShapeProto) value_;
        }
        return TensorShapeProto.getDefaultInstance();
      }
    }

    /**
     * <pre>
     * "shape"
     * </pre>
     *
     * <code>.tensorflow.TensorShapeProto shape = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder>
    getShapeFieldBuilder() {
      if (shapeBuilder_ == null) {
        if (!(valueCase_ == 7)) {
          value_ = TensorShapeProto.getDefaultInstance();
        }
        shapeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            TensorShapeProto, TensorShapeProto.Builder, TensorShapeProtoOrBuilder>(
            (TensorShapeProto) value_,
            getParentForChildren(),
            isClean());
        value_ = null;
      }
      valueCase_ = 7;
      onChanged();;
      return shapeBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        TensorProto, TensorProto.Builder, TensorProtoOrBuilder> tensorBuilder_;

    /**
     * <pre>
     * "tensor"
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor = 8;</code>
     */
    public boolean hasTensor() {
      return valueCase_ == 8;
    }

    /**
     * <pre>
     * "tensor"
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor = 8;</code>
     */
    public TensorProto getTensor() {
      if (tensorBuilder_ == null) {
        if (valueCase_ == 8) {
          return (TensorProto) value_;
        }
        return TensorProto.getDefaultInstance();
      } else {
        if (valueCase_ == 8) {
          return tensorBuilder_.getMessage();
        }
        return TensorProto.getDefaultInstance();
      }
    }

    /**
     * <pre>
     * "tensor"
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor = 8;</code>
     */
    public Builder setTensor(TensorProto value) {
      if (tensorBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        value_ = value;
        onChanged();
      } else {
        tensorBuilder_.setMessage(value);
      }
      valueCase_ = 8;
      return this;
    }

    /**
     * <pre>
     * "tensor"
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor = 8;</code>
     */
    public Builder setTensor(
        TensorProto.Builder builderForValue) {
      if (tensorBuilder_ == null) {
        value_ = builderForValue.build();
        onChanged();
      } else {
        tensorBuilder_.setMessage(builderForValue.build());
      }
      valueCase_ = 8;
      return this;
    }

    /**
     * <pre>
     * "tensor"
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor = 8;</code>
     */
    public Builder mergeTensor(TensorProto value) {
      if (tensorBuilder_ == null) {
        if (valueCase_ == 8 &&
            value_ != TensorProto.getDefaultInstance()) {
          value_ = TensorProto.newBuilder((TensorProto) value_)
              .mergeFrom(value).buildPartial();
        } else {
          value_ = value;
        }
        onChanged();
      } else {
        if (valueCase_ == 8) {
          tensorBuilder_.mergeFrom(value);
        }
        tensorBuilder_.setMessage(value);
      }
      valueCase_ = 8;
      return this;
    }

    /**
     * <pre>
     * "tensor"
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor = 8;</code>
     */
    public Builder clearTensor() {
      if (tensorBuilder_ == null) {
        if (valueCase_ == 8) {
          valueCase_ = 0;
          value_ = null;
          onChanged();
        }
      } else {
        if (valueCase_ == 8) {
          valueCase_ = 0;
          value_ = null;
        }
        tensorBuilder_.clear();
      }
      return this;
    }

    /**
     * <pre>
     * "tensor"
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor = 8;</code>
     */
    public TensorProto.Builder getTensorBuilder() {
      return getTensorFieldBuilder().getBuilder();
    }

    /**
     * <pre>
     * "tensor"
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor = 8;</code>
     */
    public TensorProtoOrBuilder getTensorOrBuilder() {
      if ((valueCase_ == 8) && (tensorBuilder_ != null)) {
        return tensorBuilder_.getMessageOrBuilder();
      } else {
        if (valueCase_ == 8) {
          return (TensorProto) value_;
        }
        return TensorProto.getDefaultInstance();
      }
    }

    /**
     * <pre>
     * "tensor"
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor = 8;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        TensorProto, TensorProto.Builder, TensorProtoOrBuilder>
    getTensorFieldBuilder() {
      if (tensorBuilder_ == null) {
        if (!(valueCase_ == 8)) {
          value_ = TensorProto.getDefaultInstance();
        }
        tensorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            TensorProto, TensorProto.Builder, TensorProtoOrBuilder>(
            (TensorProto) value_,
            getParentForChildren(),
            isClean());
        value_ = null;
      }
      valueCase_ = 8;
      onChanged();;
      return tensorBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        ListValue, ListValue.Builder, ListValueOrBuilder> listBuilder_;

    /**
     * <pre>
     * any "list(...)"
     * </pre>
     *
     * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
     */
    public boolean hasList() {
      return valueCase_ == 1;
    }

    /**
     * <pre>
     * any "list(...)"
     * </pre>
     *
     * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
     */
    public ListValue getList() {
      if (listBuilder_ == null) {
        if (valueCase_ == 1) {
          return (ListValue) value_;
        }
        return ListValue.getDefaultInstance();
      } else {
        if (valueCase_ == 1) {
          return listBuilder_.getMessage();
        }
        return ListValue.getDefaultInstance();
      }
    }

    /**
     * <pre>
     * any "list(...)"
     * </pre>
     *
     * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
     */
    public Builder setList(ListValue value) {
      if (listBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        value_ = value;
        onChanged();
      } else {
        listBuilder_.setMessage(value);
      }
      valueCase_ = 1;
      return this;
    }

    /**
     * <pre>
     * any "list(...)"
     * </pre>
     *
     * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
     */
    public Builder setList(
        ListValue.Builder builderForValue) {
      if (listBuilder_ == null) {
        value_ = builderForValue.build();
        onChanged();
      } else {
        listBuilder_.setMessage(builderForValue.build());
      }
      valueCase_ = 1;
      return this;
    }

    /**
     * <pre>
     * any "list(...)"
     * </pre>
     *
     * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
     */
    public Builder mergeList(ListValue value) {
      if (listBuilder_ == null) {
        if (valueCase_ == 1 &&
            value_ != ListValue.getDefaultInstance()) {
          value_ = ListValue.newBuilder((ListValue) value_)
              .mergeFrom(value).buildPartial();
        } else {
          value_ = value;
        }
        onChanged();
      } else {
        if (valueCase_ == 1) {
          listBuilder_.mergeFrom(value);
        }
        listBuilder_.setMessage(value);
      }
      valueCase_ = 1;
      return this;
    }

    /**
     * <pre>
     * any "list(...)"
     * </pre>
     *
     * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
     */
    public Builder clearList() {
      if (listBuilder_ == null) {
        if (valueCase_ == 1) {
          valueCase_ = 0;
          value_ = null;
          onChanged();
        }
      } else {
        if (valueCase_ == 1) {
          valueCase_ = 0;
          value_ = null;
        }
        listBuilder_.clear();
      }
      return this;
    }

    /**
     * <pre>
     * any "list(...)"
     * </pre>
     *
     * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
     */
    public ListValue.Builder getListBuilder() {
      return getListFieldBuilder().getBuilder();
    }

    /**
     * <pre>
     * any "list(...)"
     * </pre>
     *
     * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
     */
    public ListValueOrBuilder getListOrBuilder() {
      if ((valueCase_ == 1) && (listBuilder_ != null)) {
        return listBuilder_.getMessageOrBuilder();
      } else {
        if (valueCase_ == 1) {
          return (ListValue) value_;
        }
        return ListValue.getDefaultInstance();
      }
    }

    /**
     * <pre>
     * any "list(...)"
     * </pre>
     *
     * <code>.tensorflow.AttrValue.ListValue list = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        ListValue, ListValue.Builder, ListValueOrBuilder>
    getListFieldBuilder() {
      if (listBuilder_ == null) {
        if (!(valueCase_ == 1)) {
          value_ = ListValue.getDefaultInstance();
        }
        listBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            ListValue, ListValue.Builder, ListValueOrBuilder>(
            (ListValue) value_,
            getParentForChildren(),
            isClean());
        value_ = null;
      }
      valueCase_ = 1;
      onChanged();;
      return listBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder> funcBuilder_;

    /**
     * <pre>
     * "func" represents a function. func.name is a function's name or
     * a primitive op's name. func.attr.first is the name of an attr
     * defined for that function. func.attr.second is the value for
     * that attr in the instantiation.
     * </pre>
     *
     * <code>.tensorflow.NameAttrList func = 10;</code>
     */
    public boolean hasFunc() {
      return valueCase_ == 10;
    }

    /**
     * <pre>
     * "func" represents a function. func.name is a function's name or
     * a primitive op's name. func.attr.first is the name of an attr
     * defined for that function. func.attr.second is the value for
     * that attr in the instantiation.
     * </pre>
     *
     * <code>.tensorflow.NameAttrList func = 10;</code>
     */
    public NameAttrList getFunc() {
      if (funcBuilder_ == null) {
        if (valueCase_ == 10) {
          return (NameAttrList) value_;
        }
        return NameAttrList.getDefaultInstance();
      } else {
        if (valueCase_ == 10) {
          return funcBuilder_.getMessage();
        }
        return NameAttrList.getDefaultInstance();
      }
    }

    /**
     * <pre>
     * "func" represents a function. func.name is a function's name or
     * a primitive op's name. func.attr.first is the name of an attr
     * defined for that function. func.attr.second is the value for
     * that attr in the instantiation.
     * </pre>
     *
     * <code>.tensorflow.NameAttrList func = 10;</code>
     */
    public Builder setFunc(NameAttrList value) {
      if (funcBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        value_ = value;
        onChanged();
      } else {
        funcBuilder_.setMessage(value);
      }
      valueCase_ = 10;
      return this;
    }

    /**
     * <pre>
     * "func" represents a function. func.name is a function's name or
     * a primitive op's name. func.attr.first is the name of an attr
     * defined for that function. func.attr.second is the value for
     * that attr in the instantiation.
     * </pre>
     *
     * <code>.tensorflow.NameAttrList func = 10;</code>
     */
    public Builder setFunc(
        NameAttrList.Builder builderForValue) {
      if (funcBuilder_ == null) {
        value_ = builderForValue.build();
        onChanged();
      } else {
        funcBuilder_.setMessage(builderForValue.build());
      }
      valueCase_ = 10;
      return this;
    }

    /**
     * <pre>
     * "func" represents a function. func.name is a function's name or
     * a primitive op's name. func.attr.first is the name of an attr
     * defined for that function. func.attr.second is the value for
     * that attr in the instantiation.
     * </pre>
     *
     * <code>.tensorflow.NameAttrList func = 10;</code>
     */
    public Builder mergeFunc(NameAttrList value) {
      if (funcBuilder_ == null) {
        if (valueCase_ == 10 &&
            value_ != NameAttrList.getDefaultInstance()) {
          value_ = NameAttrList.newBuilder((NameAttrList) value_)
              .mergeFrom(value).buildPartial();
        } else {
          value_ = value;
        }
        onChanged();
      } else {
        if (valueCase_ == 10) {
          funcBuilder_.mergeFrom(value);
        }
        funcBuilder_.setMessage(value);
      }
      valueCase_ = 10;
      return this;
    }

    /**
     * <pre>
     * "func" represents a function. func.name is a function's name or
     * a primitive op's name. func.attr.first is the name of an attr
     * defined for that function. func.attr.second is the value for
     * that attr in the instantiation.
     * </pre>
     *
     * <code>.tensorflow.NameAttrList func = 10;</code>
     */
    public Builder clearFunc() {
      if (funcBuilder_ == null) {
        if (valueCase_ == 10) {
          valueCase_ = 0;
          value_ = null;
          onChanged();
        }
      } else {
        if (valueCase_ == 10) {
          valueCase_ = 0;
          value_ = null;
        }
        funcBuilder_.clear();
      }
      return this;
    }

    /**
     * <pre>
     * "func" represents a function. func.name is a function's name or
     * a primitive op's name. func.attr.first is the name of an attr
     * defined for that function. func.attr.second is the value for
     * that attr in the instantiation.
     * </pre>
     *
     * <code>.tensorflow.NameAttrList func = 10;</code>
     */
    public NameAttrList.Builder getFuncBuilder() {
      return getFuncFieldBuilder().getBuilder();
    }

    /**
     * <pre>
     * "func" represents a function. func.name is a function's name or
     * a primitive op's name. func.attr.first is the name of an attr
     * defined for that function. func.attr.second is the value for
     * that attr in the instantiation.
     * </pre>
     *
     * <code>.tensorflow.NameAttrList func = 10;</code>
     */
    public NameAttrListOrBuilder getFuncOrBuilder() {
      if ((valueCase_ == 10) && (funcBuilder_ != null)) {
        return funcBuilder_.getMessageOrBuilder();
      } else {
        if (valueCase_ == 10) {
          return (NameAttrList) value_;
        }
        return NameAttrList.getDefaultInstance();
      }
    }

    /**
     * <pre>
     * "func" represents a function. func.name is a function's name or
     * a primitive op's name. func.attr.first is the name of an attr
     * defined for that function. func.attr.second is the value for
     * that attr in the instantiation.
     * </pre>
     *
     * <code>.tensorflow.NameAttrList func = 10;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder>
    getFuncFieldBuilder() {
      if (funcBuilder_ == null) {
        if (!(valueCase_ == 10)) {
          value_ = NameAttrList.getDefaultInstance();
        }
        funcBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            NameAttrList, NameAttrList.Builder, NameAttrListOrBuilder>(
            (NameAttrList) value_,
            getParentForChildren(),
            isClean());
        value_ = null;
      }
      valueCase_ = 10;
      onChanged();;
      return funcBuilder_;
    }

    /**
     * <pre>
     * This is a placeholder only used in nodes defined inside a
     * function.  It indicates the attr value will be supplied when
     * the function is instantiated.  For example, let us suppose a
     * node "N" in function "FN". "N" has an attr "A" with value
     * placeholder = "foo". When FN is instantiated with attr "foo"
     * set to "bar", the instantiated node N's attr A will have been
     * given the value "bar".
     * </pre>
     *
     * <code>string placeholder = 9;</code>
     */
    public String getPlaceholder() {
      Object ref = "";
      if (valueCase_ == 9) {
        ref = value_;
      }
      if (!(ref instanceof String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        String s = bs.toStringUtf8();
        if (valueCase_ == 9) {
          value_ = s;
        }
        return s;
      } else {
        return (String) ref;
      }
    }

    /**
     * <pre>
     * This is a placeholder only used in nodes defined inside a
     * function.  It indicates the attr value will be supplied when
     * the function is instantiated.  For example, let us suppose a
     * node "N" in function "FN". "N" has an attr "A" with value
     * placeholder = "foo". When FN is instantiated with attr "foo"
     * set to "bar", the instantiated node N's attr A will have been
     * given the value "bar".
     * </pre>
     *
     * <code>string placeholder = 9;</code>
     */
    public com.google.protobuf.ByteString
    getPlaceholderBytes() {
      Object ref = "";
      if (valueCase_ == 9) {
        ref = value_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (String) ref);
        if (valueCase_ == 9) {
          value_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     * <pre>
     * This is a placeholder only used in nodes defined inside a
     * function.  It indicates the attr value will be supplied when
     * the function is instantiated.  For example, let us suppose a
     * node "N" in function "FN". "N" has an attr "A" with value
     * placeholder = "foo". When FN is instantiated with attr "foo"
     * set to "bar", the instantiated node N's attr A will have been
     * given the value "bar".
     * </pre>
     *
     * <code>string placeholder = 9;</code>
     */
    public Builder setPlaceholder(
        String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      valueCase_ = 9;
      value_ = value;
      onChanged();
      return this;
    }

    /**
     * <pre>
     * This is a placeholder only used in nodes defined inside a
     * function.  It indicates the attr value will be supplied when
     * the function is instantiated.  For example, let us suppose a
     * node "N" in function "FN". "N" has an attr "A" with value
     * placeholder = "foo". When FN is instantiated with attr "foo"
     * set to "bar", the instantiated node N's attr A will have been
     * given the value "bar".
     * </pre>
     *
     * <code>string placeholder = 9;</code>
     */
    public Builder clearPlaceholder() {
      if (valueCase_ == 9) {
        valueCase_ = 0;
        value_ = null;
        onChanged();
      }
      return this;
    }

    /**
     * <pre>
     * This is a placeholder only used in nodes defined inside a
     * function.  It indicates the attr value will be supplied when
     * the function is instantiated.  For example, let us suppose a
     * node "N" in function "FN". "N" has an attr "A" with value
     * placeholder = "foo". When FN is instantiated with attr "foo"
     * set to "bar", the instantiated node N's attr A will have been
     * given the value "bar".
     * </pre>
     *
     * <code>string placeholder = 9;</code>
     */
    public Builder setPlaceholderBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      valueCase_ = 9;
      value_ = value;
      onChanged();
      return this;
    }

    @Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:tensorflow.AttrValue)
  }

  // @@protoc_insertion_point(class_scope:tensorflow.AttrValue)
  private static final AttrValue DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new AttrValue();
  }

  public static AttrValue getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<AttrValue>
      PARSER = new com.google.protobuf.AbstractParser<AttrValue>() {
    @Override
    public AttrValue parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new AttrValue(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<AttrValue> parser() {
    return PARSER;
  }

  @Override
  public com.google.protobuf.Parser<AttrValue> getParserForType() {
    return PARSER;
  }

  @Override
  public AttrValue getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

