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

package org.tensorflow.proto.framework;

/**
 * <pre>
 * Indicates how a distributed variable will be aggregated.
 * </pre>
 *
 * Protobuf enum {@code tensorflow.VariableAggregation}
 */
public enum VariableAggregation
    implements com.google.protobuf.ProtocolMessageEnum {
  /**
   * <pre>
   * `NONE`: This is the default, giving an error if you use a
   * variable-update operation with multiple replicas.
   * </pre>
   *
   * <code>VARIABLE_AGGREGATION_NONE = 0;</code>
   */
  VARIABLE_AGGREGATION_NONE(0),
  /**
   * <pre>
   * `SUM`: Add the updates across replicas.
   * </pre>
   *
   * <code>VARIABLE_AGGREGATION_SUM = 1;</code>
   */
  VARIABLE_AGGREGATION_SUM(1),
  /**
   * <pre>
   * `MEAN`: Take the arithmetic mean ("average") of the updates across
   * replicas.
   * </pre>
   *
   * <code>VARIABLE_AGGREGATION_MEAN = 2;</code>
   */
  VARIABLE_AGGREGATION_MEAN(2),
  /**
   * <pre>
   * `ONLY_FIRST_REPLICA`: This is for when every replica is performing the same
   * update, but we only want to perform the update once. Used, e.g., for the
   * global step counter.
   * </pre>
   *
   * <code>VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA = 3;</code>
   */
  VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA(3),
  UNRECOGNIZED(-1),
  ;

  /**
   * <pre>
   * `NONE`: This is the default, giving an error if you use a
   * variable-update operation with multiple replicas.
   * </pre>
   *
   * <code>VARIABLE_AGGREGATION_NONE = 0;</code>
   */
  public static final int VARIABLE_AGGREGATION_NONE_VALUE = 0;
  /**
   * <pre>
   * `SUM`: Add the updates across replicas.
   * </pre>
   *
   * <code>VARIABLE_AGGREGATION_SUM = 1;</code>
   */
  public static final int VARIABLE_AGGREGATION_SUM_VALUE = 1;
  /**
   * <pre>
   * `MEAN`: Take the arithmetic mean ("average") of the updates across
   * replicas.
   * </pre>
   *
   * <code>VARIABLE_AGGREGATION_MEAN = 2;</code>
   */
  public static final int VARIABLE_AGGREGATION_MEAN_VALUE = 2;
  /**
   * <pre>
   * `ONLY_FIRST_REPLICA`: This is for when every replica is performing the same
   * update, but we only want to perform the update once. Used, e.g., for the
   * global step counter.
   * </pre>
   *
   * <code>VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA = 3;</code>
   */
  public static final int VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA_VALUE = 3;


  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 VariableAggregation valueOf(int value) {
    return forNumber(value);
  }

  public static VariableAggregation forNumber(int value) {
    switch (value) {
      case 0: return VARIABLE_AGGREGATION_NONE;
      case 1: return VARIABLE_AGGREGATION_SUM;
      case 2: return VARIABLE_AGGREGATION_MEAN;
      case 3: return VARIABLE_AGGREGATION_ONLY_FIRST_REPLICA;
      default: return null;
    }
  }

  public static com.google.protobuf.Internal.EnumLiteMap<VariableAggregation>
      internalGetValueMap() {
    return internalValueMap;
  }
  private static final com.google.protobuf.Internal.EnumLiteMap<
      VariableAggregation> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<VariableAggregation>() {
          public VariableAggregation findValueByNumber(int number) {
            return VariableAggregation.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.framework.VariableProtos.getDescriptor().getEnumTypes().get(1);
  }

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

  public static VariableAggregation 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 VariableAggregation(int value) {
    this.value = value;
  }

  // @@protoc_insertion_point(enum_scope:tensorflow.VariableAggregation)
}

