Enum DatasetOptions.AutoShardPolicy
java.lang.Object
java.lang.Enum<DatasetOptions.AutoShardPolicy>
org.tensorflow.proto.data.DatasetOptions.AutoShardPolicy
- All Implemented Interfaces:
Internal.EnumLite, ProtocolMessageEnum, Serializable, Comparable<DatasetOptions.AutoShardPolicy>
- Enclosing class:
DatasetOptions
public static enum DatasetOptions.AutoShardPolicy
extends Enum<DatasetOptions.AutoShardPolicy>
implements ProtocolMessageEnum
Represents the type of auto-sharding we enable.Protobuf enum
tensorflow.data.AutoShardPolicy-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.DATA: Shards by elements produced by the dataset.FILE: Shards by input files (i.e. each worker will get a set of files to process).HINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a placeholder to replace with `shard(num_workers, worker_index)`.OFF: No sharding will be performed. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.static final intDATA: Shards by elements produced by the dataset.static final intFILE: Shards by input files (i.e. each worker will get a set of files to process).static final intHINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a placeholder to replace with `shard(num_workers, worker_index)`.static final intOFF: No sharding will be performed. -
Method Summary
Modifier and TypeMethodDescriptionforNumber(int value) static final Descriptors.EnumDescriptorfinal intvalueOf(int value) Deprecated.Returns the enum constant of this type with the specified name.Returns the enum constant of this type with the specified name.static DatasetOptions.AutoShardPolicy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
AUTO
AUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
AUTO = 0; -
FILE
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.
FILE = 1; -
DATA
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.
DATA = 2; -
HINT
HINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a placeholder to replace with `shard(num_workers, worker_index)`.
HINT = 3; -
OFF
OFF: No sharding will be performed.
OFF = -1; -
UNRECOGNIZED
-
-
Field Details
-
AUTO_VALUE
public static final int AUTO_VALUEAUTO: Attempts FILE-based sharding, falling back to DATA-based sharding.
AUTO = 0;- See Also:
-
FILE_VALUE
public static final int FILE_VALUEFILE: 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.
FILE = 1;- See Also:
-
DATA_VALUE
public static final int DATA_VALUEDATA: 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.
DATA = 2;- See Also:
-
HINT_VALUE
public static final int HINT_VALUEHINT: Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a placeholder to replace with `shard(num_workers, worker_index)`.
HINT = 3;- See Also:
-
OFF_VALUE
public static final int OFF_VALUEOFF: No sharding will be performed.
OFF = -1;- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getNumber
public final int getNumber()- Specified by:
getNumberin interfaceInternal.EnumLite- Specified by:
getNumberin interfaceProtocolMessageEnum
-
valueOf
Deprecated.Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
value- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
forNumber
- Parameters:
value- The numeric wire value of the corresponding enum entry.- Returns:
- The enum associated with the given numeric wire value.
-
internalGetValueMap
-
getValueDescriptor
- Specified by:
getValueDescriptorin interfaceProtocolMessageEnum
-
getDescriptorForType
- Specified by:
getDescriptorForTypein interfaceProtocolMessageEnum
-
getDescriptor
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
desc- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-