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

package org.tensorflow.proto.data;

/**
 * <pre>
 * Represents the type of auto-sharding we enable.
 * </pre>
 *
 * Protobuf enum {@code tensorflow.data.AutoShardPolicy}
 */
public enum AutoShardPolicy
    implements com.google.protobuf.ProtocolMessageEnum {
  /**
   * <pre>
   * AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
   * </pre>
   *
   * <code>AUTO = 0;</code>
   */
  AUTO(0),
  /**
   * <pre>
   * FILE: Shards by input files (i.e. each worker will get a set of files to
   * process). When this option is selected, make sure that there is at least as
   * many files as workers. If there are fewer input files than workers, a
   * runtime error will be raised.
   * </pre>
   *
   * <code>FILE = 1;</code>
   */
  FILE(1),
  /**
   * <pre>
   * DATA: Shards by elements produced by the dataset. Each worker will process
   * the whole dataset and discard the portion that is not for itself. Note that
   * for this mode to correctly partitions the dataset elements, the dataset
   * needs to produce elements in a deterministic order.
   * </pre>
   *
   * <code>DATA = 2;</code>
   */
  DATA(2),
  /**
   * <pre>
   * HINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated
   * as a placeholder to replace with `shard(num_workers, worker_index)`.
   * </pre>
   *
   * <code>HINT = 3;</code>
   */
  HINT(3),
  /**
   * <pre>
   * OFF: No sharding will be performed.
   * </pre>
   *
   * <code>OFF = -1;</code>
   */
  OFF(-1),
  UNRECOGNIZED(-1),
  ;

  /**
   * <pre>
   * AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
   * </pre>
   *
   * <code>AUTO = 0;</code>
   */
  public static final int AUTO_VALUE = 0;
  /**
   * <pre>
   * FILE: Shards by input files (i.e. each worker will get a set of files to
   * process). When this option is selected, make sure that there is at least as
   * many files as workers. If there are fewer input files than workers, a
   * runtime error will be raised.
   * </pre>
   *
   * <code>FILE = 1;</code>
   */
  public static final int FILE_VALUE = 1;
  /**
   * <pre>
   * DATA: Shards by elements produced by the dataset. Each worker will process
   * the whole dataset and discard the portion that is not for itself. Note that
   * for this mode to correctly partitions the dataset elements, the dataset
   * needs to produce elements in a deterministic order.
   * </pre>
   *
   * <code>DATA = 2;</code>
   */
  public static final int DATA_VALUE = 2;
  /**
   * <pre>
   * HINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated
   * as a placeholder to replace with `shard(num_workers, worker_index)`.
   * </pre>
   *
   * <code>HINT = 3;</code>
   */
  public static final int HINT_VALUE = 3;
  /**
   * <pre>
   * OFF: No sharding will be performed.
   * </pre>
   *
   * <code>OFF = -1;</code>
   */
  public static final int OFF_VALUE = -1;


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

  public static AutoShardPolicy forNumber(int value) {
    switch (value) {
      case 0: return AUTO;
      case 1: return FILE;
      case 2: return DATA;
      case 3: return HINT;
      case -1: return OFF;
      default: return null;
    }
  }

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

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

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

  // @@protoc_insertion_point(enum_scope:tensorflow.data.AutoShardPolicy)
}

