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

package org.tensorflow.proto.util;

/**
 * <pre>
 * Protocol buffer representing the configuration of a Saver.
 * </pre>
 *
 * Protobuf type {@code tensorflow.SaverDef}
 */
public  final class SaverDef extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.SaverDef)
    SaverDefOrBuilder {
private static final long serialVersionUID = 0L;
  // Use SaverDef.newBuilder() to construct.
  private SaverDef(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private SaverDef() {
    filenameTensorName_ = "";
    saveTensorName_ = "";
    restoreOpName_ = "";
    version_ = 0;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new SaverDef();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private SaverDef(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.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: {
            java.lang.String s = input.readStringRequireUtf8();

            filenameTensorName_ = s;
            break;
          }
          case 18: {
            java.lang.String s = input.readStringRequireUtf8();

            saveTensorName_ = s;
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();

            restoreOpName_ = s;
            break;
          }
          case 32: {

            maxToKeep_ = input.readInt32();
            break;
          }
          case 40: {

            sharded_ = input.readBool();
            break;
          }
          case 53: {

            keepCheckpointEveryNHours_ = input.readFloat();
            break;
          }
          case 56: {
            int rawValue = input.readEnum();

            version_ = rawValue;
            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 org.tensorflow.proto.util.SaverProtos.internal_static_tensorflow_SaverDef_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.util.SaverProtos.internal_static_tensorflow_SaverDef_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.util.SaverDef.class, org.tensorflow.proto.util.SaverDef.Builder.class);
  }

  /**
   * <pre>
   * A version number that identifies a different on-disk checkpoint format.
   * Usually, each subclass of BaseSaverBuilder works with a particular
   * version/format.  However, it is possible that the same builder may be
   * upgraded to support a newer checkpoint format in the future.
   * </pre>
   *
   * Protobuf enum {@code tensorflow.SaverDef.CheckpointFormatVersion}
   */
  public enum CheckpointFormatVersion
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <pre>
     * Internal legacy format.
     * </pre>
     *
     * <code>LEGACY = 0;</code>
     */
    LEGACY(0),
    /**
     * <pre>
     * Deprecated format: tf.Saver() which works with tensorflow::table::Table.
     * </pre>
     *
     * <code>V1 = 1;</code>
     */
    V1(1),
    /**
     * <pre>
     * Current format: more efficient.
     * </pre>
     *
     * <code>V2 = 2;</code>
     */
    V2(2),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * Internal legacy format.
     * </pre>
     *
     * <code>LEGACY = 0;</code>
     */
    public static final int LEGACY_VALUE = 0;
    /**
     * <pre>
     * Deprecated format: tf.Saver() which works with tensorflow::table::Table.
     * </pre>
     *
     * <code>V1 = 1;</code>
     */
    public static final int V1_VALUE = 1;
    /**
     * <pre>
     * Current format: more efficient.
     * </pre>
     *
     * <code>V2 = 2;</code>
     */
    public static final int V2_VALUE = 2;


    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

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

    public static CheckpointFormatVersion forNumber(int value) {
      switch (value) {
        case 0: return LEGACY;
        case 1: return V1;
        case 2: return V2;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<CheckpointFormatVersion>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        CheckpointFormatVersion> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<CheckpointFormatVersion>() {
            public CheckpointFormatVersion findValueByNumber(int number) {
              return CheckpointFormatVersion.forNumber(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return org.tensorflow.proto.util.SaverDef.getDescriptor().getEnumTypes().get(0);
    }

    private static final CheckpointFormatVersion[] VALUES = values();

    public static CheckpointFormatVersion valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

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

    // @@protoc_insertion_point(enum_scope:tensorflow.SaverDef.CheckpointFormatVersion)
  }

  public static final int FILENAME_TENSOR_NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object filenameTensorName_;
  /**
   * <pre>
   * The name of the tensor in which to specify the filename when saving or
   * restoring a model checkpoint.
   * </pre>
   *
   * <code>string filename_tensor_name = 1;</code>
   */
  public java.lang.String getFilenameTensorName() {
    java.lang.Object ref = filenameTensorName_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      filenameTensorName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The name of the tensor in which to specify the filename when saving or
   * restoring a model checkpoint.
   * </pre>
   *
   * <code>string filename_tensor_name = 1;</code>
   */
  public com.google.protobuf.ByteString
      getFilenameTensorNameBytes() {
    java.lang.Object ref = filenameTensorName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      filenameTensorName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SAVE_TENSOR_NAME_FIELD_NUMBER = 2;
  private volatile java.lang.Object saveTensorName_;
  /**
   * <pre>
   * The operation to run when saving a model checkpoint.
   * </pre>
   *
   * <code>string save_tensor_name = 2;</code>
   */
  public java.lang.String getSaveTensorName() {
    java.lang.Object ref = saveTensorName_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      saveTensorName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The operation to run when saving a model checkpoint.
   * </pre>
   *
   * <code>string save_tensor_name = 2;</code>
   */
  public com.google.protobuf.ByteString
      getSaveTensorNameBytes() {
    java.lang.Object ref = saveTensorName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      saveTensorName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int RESTORE_OP_NAME_FIELD_NUMBER = 3;
  private volatile java.lang.Object restoreOpName_;
  /**
   * <pre>
   * The operation to run when restoring a model checkpoint.
   * </pre>
   *
   * <code>string restore_op_name = 3;</code>
   */
  public java.lang.String getRestoreOpName() {
    java.lang.Object ref = restoreOpName_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      restoreOpName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The operation to run when restoring a model checkpoint.
   * </pre>
   *
   * <code>string restore_op_name = 3;</code>
   */
  public com.google.protobuf.ByteString
      getRestoreOpNameBytes() {
    java.lang.Object ref = restoreOpName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      restoreOpName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MAX_TO_KEEP_FIELD_NUMBER = 4;
  private int maxToKeep_;
  /**
   * <pre>
   * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
   * </pre>
   *
   * <code>int32 max_to_keep = 4;</code>
   */
  public int getMaxToKeep() {
    return maxToKeep_;
  }

  public static final int SHARDED_FIELD_NUMBER = 5;
  private boolean sharded_;
  /**
   * <pre>
   * Shard the save files, one per device that has Variable nodes.
   * </pre>
   *
   * <code>bool sharded = 5;</code>
   */
  public boolean getSharded() {
    return sharded_;
  }

  public static final int KEEP_CHECKPOINT_EVERY_N_HOURS_FIELD_NUMBER = 6;
  private float keepCheckpointEveryNHours_;
  /**
   * <pre>
   * How often to keep an additional checkpoint. If not specified, only the last
   * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
   * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
   * for every n hours of training.
   * </pre>
   *
   * <code>float keep_checkpoint_every_n_hours = 6;</code>
   */
  public float getKeepCheckpointEveryNHours() {
    return keepCheckpointEveryNHours_;
  }

  public static final int VERSION_FIELD_NUMBER = 7;
  private int version_;
  /**
   * <code>.tensorflow.SaverDef.CheckpointFormatVersion version = 7;</code>
   */
  public int getVersionValue() {
    return version_;
  }
  /**
   * <code>.tensorflow.SaverDef.CheckpointFormatVersion version = 7;</code>
   */
  public org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion getVersion() {
    @SuppressWarnings("deprecation")
    org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion result = org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.valueOf(version_);
    return result == null ? org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.UNRECOGNIZED : result;
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getFilenameTensorNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, filenameTensorName_);
    }
    if (!getSaveTensorNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, saveTensorName_);
    }
    if (!getRestoreOpNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, restoreOpName_);
    }
    if (maxToKeep_ != 0) {
      output.writeInt32(4, maxToKeep_);
    }
    if (sharded_ != false) {
      output.writeBool(5, sharded_);
    }
    if (keepCheckpointEveryNHours_ != 0F) {
      output.writeFloat(6, keepCheckpointEveryNHours_);
    }
    if (version_ != org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.LEGACY.getNumber()) {
      output.writeEnum(7, version_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getFilenameTensorNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filenameTensorName_);
    }
    if (!getSaveTensorNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, saveTensorName_);
    }
    if (!getRestoreOpNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, restoreOpName_);
    }
    if (maxToKeep_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(4, maxToKeep_);
    }
    if (sharded_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(5, sharded_);
    }
    if (keepCheckpointEveryNHours_ != 0F) {
      size += com.google.protobuf.CodedOutputStream
        .computeFloatSize(6, keepCheckpointEveryNHours_);
    }
    if (version_ != org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.LEGACY.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(7, version_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof org.tensorflow.proto.util.SaverDef)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.util.SaverDef other = (org.tensorflow.proto.util.SaverDef) obj;

    if (!getFilenameTensorName()
        .equals(other.getFilenameTensorName())) return false;
    if (!getSaveTensorName()
        .equals(other.getSaveTensorName())) return false;
    if (!getRestoreOpName()
        .equals(other.getRestoreOpName())) return false;
    if (getMaxToKeep()
        != other.getMaxToKeep()) return false;
    if (getSharded()
        != other.getSharded()) return false;
    if (java.lang.Float.floatToIntBits(getKeepCheckpointEveryNHours())
        != java.lang.Float.floatToIntBits(
            other.getKeepCheckpointEveryNHours())) return false;
    if (version_ != other.version_) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + FILENAME_TENSOR_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getFilenameTensorName().hashCode();
    hash = (37 * hash) + SAVE_TENSOR_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getSaveTensorName().hashCode();
    hash = (37 * hash) + RESTORE_OP_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getRestoreOpName().hashCode();
    hash = (37 * hash) + MAX_TO_KEEP_FIELD_NUMBER;
    hash = (53 * hash) + getMaxToKeep();
    hash = (37 * hash) + SHARDED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getSharded());
    hash = (37 * hash) + KEEP_CHECKPOINT_EVERY_N_HOURS_FIELD_NUMBER;
    hash = (53 * hash) + java.lang.Float.floatToIntBits(
        getKeepCheckpointEveryNHours());
    hash = (37 * hash) + VERSION_FIELD_NUMBER;
    hash = (53 * hash) + version_;
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.proto.util.SaverDef parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.util.SaverDef parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.util.SaverDef parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.util.SaverDef parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.util.SaverDef parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.util.SaverDef parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.util.SaverDef parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.util.SaverDef 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 org.tensorflow.proto.util.SaverDef parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.util.SaverDef 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 org.tensorflow.proto.util.SaverDef parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.util.SaverDef parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.tensorflow.proto.util.SaverDef prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * Protocol buffer representing the configuration of a Saver.
   * </pre>
   *
   * Protobuf type {@code tensorflow.SaverDef}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.SaverDef)
      org.tensorflow.proto.util.SaverDefOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.util.SaverProtos.internal_static_tensorflow_SaverDef_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.util.SaverProtos.internal_static_tensorflow_SaverDef_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.util.SaverDef.class, org.tensorflow.proto.util.SaverDef.Builder.class);
    }

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

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      filenameTensorName_ = "";

      saveTensorName_ = "";

      restoreOpName_ = "";

      maxToKeep_ = 0;

      sharded_ = false;

      keepCheckpointEveryNHours_ = 0F;

      version_ = 0;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.proto.util.SaverProtos.internal_static_tensorflow_SaverDef_descriptor;
    }

    @java.lang.Override
    public org.tensorflow.proto.util.SaverDef getDefaultInstanceForType() {
      return org.tensorflow.proto.util.SaverDef.getDefaultInstance();
    }

    @java.lang.Override
    public org.tensorflow.proto.util.SaverDef build() {
      org.tensorflow.proto.util.SaverDef result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public org.tensorflow.proto.util.SaverDef buildPartial() {
      org.tensorflow.proto.util.SaverDef result = new org.tensorflow.proto.util.SaverDef(this);
      result.filenameTensorName_ = filenameTensorName_;
      result.saveTensorName_ = saveTensorName_;
      result.restoreOpName_ = restoreOpName_;
      result.maxToKeep_ = maxToKeep_;
      result.sharded_ = sharded_;
      result.keepCheckpointEveryNHours_ = keepCheckpointEveryNHours_;
      result.version_ = version_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tensorflow.proto.util.SaverDef) {
        return mergeFrom((org.tensorflow.proto.util.SaverDef)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.util.SaverDef other) {
      if (other == org.tensorflow.proto.util.SaverDef.getDefaultInstance()) return this;
      if (!other.getFilenameTensorName().isEmpty()) {
        filenameTensorName_ = other.filenameTensorName_;
        onChanged();
      }
      if (!other.getSaveTensorName().isEmpty()) {
        saveTensorName_ = other.saveTensorName_;
        onChanged();
      }
      if (!other.getRestoreOpName().isEmpty()) {
        restoreOpName_ = other.restoreOpName_;
        onChanged();
      }
      if (other.getMaxToKeep() != 0) {
        setMaxToKeep(other.getMaxToKeep());
      }
      if (other.getSharded() != false) {
        setSharded(other.getSharded());
      }
      if (other.getKeepCheckpointEveryNHours() != 0F) {
        setKeepCheckpointEveryNHours(other.getKeepCheckpointEveryNHours());
      }
      if (other.version_ != 0) {
        setVersionValue(other.getVersionValue());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

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

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

    private java.lang.Object filenameTensorName_ = "";
    /**
     * <pre>
     * The name of the tensor in which to specify the filename when saving or
     * restoring a model checkpoint.
     * </pre>
     *
     * <code>string filename_tensor_name = 1;</code>
     */
    public java.lang.String getFilenameTensorName() {
      java.lang.Object ref = filenameTensorName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        filenameTensorName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The name of the tensor in which to specify the filename when saving or
     * restoring a model checkpoint.
     * </pre>
     *
     * <code>string filename_tensor_name = 1;</code>
     */
    public com.google.protobuf.ByteString
        getFilenameTensorNameBytes() {
      java.lang.Object ref = filenameTensorName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        filenameTensorName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The name of the tensor in which to specify the filename when saving or
     * restoring a model checkpoint.
     * </pre>
     *
     * <code>string filename_tensor_name = 1;</code>
     */
    public Builder setFilenameTensorName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      filenameTensorName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The name of the tensor in which to specify the filename when saving or
     * restoring a model checkpoint.
     * </pre>
     *
     * <code>string filename_tensor_name = 1;</code>
     */
    public Builder clearFilenameTensorName() {
      
      filenameTensorName_ = getDefaultInstance().getFilenameTensorName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The name of the tensor in which to specify the filename when saving or
     * restoring a model checkpoint.
     * </pre>
     *
     * <code>string filename_tensor_name = 1;</code>
     */
    public Builder setFilenameTensorNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      filenameTensorName_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object saveTensorName_ = "";
    /**
     * <pre>
     * The operation to run when saving a model checkpoint.
     * </pre>
     *
     * <code>string save_tensor_name = 2;</code>
     */
    public java.lang.String getSaveTensorName() {
      java.lang.Object ref = saveTensorName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        saveTensorName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The operation to run when saving a model checkpoint.
     * </pre>
     *
     * <code>string save_tensor_name = 2;</code>
     */
    public com.google.protobuf.ByteString
        getSaveTensorNameBytes() {
      java.lang.Object ref = saveTensorName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        saveTensorName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The operation to run when saving a model checkpoint.
     * </pre>
     *
     * <code>string save_tensor_name = 2;</code>
     */
    public Builder setSaveTensorName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      saveTensorName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The operation to run when saving a model checkpoint.
     * </pre>
     *
     * <code>string save_tensor_name = 2;</code>
     */
    public Builder clearSaveTensorName() {
      
      saveTensorName_ = getDefaultInstance().getSaveTensorName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The operation to run when saving a model checkpoint.
     * </pre>
     *
     * <code>string save_tensor_name = 2;</code>
     */
    public Builder setSaveTensorNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      saveTensorName_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object restoreOpName_ = "";
    /**
     * <pre>
     * The operation to run when restoring a model checkpoint.
     * </pre>
     *
     * <code>string restore_op_name = 3;</code>
     */
    public java.lang.String getRestoreOpName() {
      java.lang.Object ref = restoreOpName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        restoreOpName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The operation to run when restoring a model checkpoint.
     * </pre>
     *
     * <code>string restore_op_name = 3;</code>
     */
    public com.google.protobuf.ByteString
        getRestoreOpNameBytes() {
      java.lang.Object ref = restoreOpName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        restoreOpName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The operation to run when restoring a model checkpoint.
     * </pre>
     *
     * <code>string restore_op_name = 3;</code>
     */
    public Builder setRestoreOpName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      restoreOpName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The operation to run when restoring a model checkpoint.
     * </pre>
     *
     * <code>string restore_op_name = 3;</code>
     */
    public Builder clearRestoreOpName() {
      
      restoreOpName_ = getDefaultInstance().getRestoreOpName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The operation to run when restoring a model checkpoint.
     * </pre>
     *
     * <code>string restore_op_name = 3;</code>
     */
    public Builder setRestoreOpNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      restoreOpName_ = value;
      onChanged();
      return this;
    }

    private int maxToKeep_ ;
    /**
     * <pre>
     * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
     * </pre>
     *
     * <code>int32 max_to_keep = 4;</code>
     */
    public int getMaxToKeep() {
      return maxToKeep_;
    }
    /**
     * <pre>
     * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
     * </pre>
     *
     * <code>int32 max_to_keep = 4;</code>
     */
    public Builder setMaxToKeep(int value) {
      
      maxToKeep_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
     * </pre>
     *
     * <code>int32 max_to_keep = 4;</code>
     */
    public Builder clearMaxToKeep() {
      
      maxToKeep_ = 0;
      onChanged();
      return this;
    }

    private boolean sharded_ ;
    /**
     * <pre>
     * Shard the save files, one per device that has Variable nodes.
     * </pre>
     *
     * <code>bool sharded = 5;</code>
     */
    public boolean getSharded() {
      return sharded_;
    }
    /**
     * <pre>
     * Shard the save files, one per device that has Variable nodes.
     * </pre>
     *
     * <code>bool sharded = 5;</code>
     */
    public Builder setSharded(boolean value) {
      
      sharded_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Shard the save files, one per device that has Variable nodes.
     * </pre>
     *
     * <code>bool sharded = 5;</code>
     */
    public Builder clearSharded() {
      
      sharded_ = false;
      onChanged();
      return this;
    }

    private float keepCheckpointEveryNHours_ ;
    /**
     * <pre>
     * How often to keep an additional checkpoint. If not specified, only the last
     * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
     * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
     * for every n hours of training.
     * </pre>
     *
     * <code>float keep_checkpoint_every_n_hours = 6;</code>
     */
    public float getKeepCheckpointEveryNHours() {
      return keepCheckpointEveryNHours_;
    }
    /**
     * <pre>
     * How often to keep an additional checkpoint. If not specified, only the last
     * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
     * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
     * for every n hours of training.
     * </pre>
     *
     * <code>float keep_checkpoint_every_n_hours = 6;</code>
     */
    public Builder setKeepCheckpointEveryNHours(float value) {
      
      keepCheckpointEveryNHours_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * How often to keep an additional checkpoint. If not specified, only the last
     * "max_to_keep" checkpoints are kept; if specified, in addition to keeping
     * the last "max_to_keep" checkpoints, an additional checkpoint will be kept
     * for every n hours of training.
     * </pre>
     *
     * <code>float keep_checkpoint_every_n_hours = 6;</code>
     */
    public Builder clearKeepCheckpointEveryNHours() {
      
      keepCheckpointEveryNHours_ = 0F;
      onChanged();
      return this;
    }

    private int version_ = 0;
    /**
     * <code>.tensorflow.SaverDef.CheckpointFormatVersion version = 7;</code>
     */
    public int getVersionValue() {
      return version_;
    }
    /**
     * <code>.tensorflow.SaverDef.CheckpointFormatVersion version = 7;</code>
     */
    public Builder setVersionValue(int value) {
      version_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>.tensorflow.SaverDef.CheckpointFormatVersion version = 7;</code>
     */
    public org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion getVersion() {
      @SuppressWarnings("deprecation")
      org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion result = org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.valueOf(version_);
      return result == null ? org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion.UNRECOGNIZED : result;
    }
    /**
     * <code>.tensorflow.SaverDef.CheckpointFormatVersion version = 7;</code>
     */
    public Builder setVersion(org.tensorflow.proto.util.SaverDef.CheckpointFormatVersion value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      version_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <code>.tensorflow.SaverDef.CheckpointFormatVersion version = 7;</code>
     */
    public Builder clearVersion() {
      
      version_ = 0;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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


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

  // @@protoc_insertion_point(class_scope:tensorflow.SaverDef)
  private static final org.tensorflow.proto.util.SaverDef DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tensorflow.proto.util.SaverDef();
  }

  public static org.tensorflow.proto.util.SaverDef getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public org.tensorflow.proto.util.SaverDef getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

