Enum DataService.ProcessingModeDef.ShardingPolicy
java.lang.Object
java.lang.Enum<DataService.ProcessingModeDef.ShardingPolicy>
org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy
- All Implemented Interfaces:
Internal.EnumLite, ProtocolMessageEnum, Serializable, Comparable<DataService.ProcessingModeDef.ShardingPolicy>
- Enclosing class:
DataService.ProcessingModeDef
public static enum DataService.ProcessingModeDef.ShardingPolicy
extends Enum<DataService.ProcessingModeDef.ShardingPolicy>
implements ProtocolMessageEnum
Specifies how data is sharded among tf.data service workers.Protobuf enum
tensorflow.data.ProcessingModeDef.ShardingPolicy-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionShards by elements produced by the dataset.The input dataset is dynamically split among workers at runtime.The following are static sharding policies.Attempts FILE-based sharding, falling back to DATA-based sharding on failures.Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a placeholder to replace with `shard(num_workers, worker_index)`.No sharding will be performed. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intShards by elements produced by the dataset.static final intThe input dataset is dynamically split among workers at runtime.static final intAttempts FILE-based sharding, falling back to DATA-based sharding on failures.static final intThe following are static sharding policies.static final intLooks for the presence of `shard(SHARD_HINT, ...)` which is treated as a placeholder to replace with `shard(num_workers, worker_index)`.static final intNo 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.values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
OFF
No sharding will be performed. Each worker produces the entire dataset without any sharding. With this mode, the best practice is to shuffle the dataset nondeterministically so that workers process the dataset in different orders.
OFF = 0; -
DYNAMIC
The input dataset is dynamically split among workers at runtime. Each worker gets the next split when it reads data from the dispatcher. There is no fixed sharding with this mode.
DYNAMIC = 1; -
FILE
The following are static sharding policies. The semantics are similar to `tf.data.experimental.AutoShardPolicy`. These policies require: * The tf.data service cluster has a fixed size, and you need to specify the workers in DispatcherConfig. * Each client only reads from the local tf.data service worker. Shards by input files (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 = 2; -
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 = 3; -
FILE_OR_DATA
Attempts FILE-based sharding, falling back to DATA-based sharding on failures.
FILE_OR_DATA = 4; -
HINT
Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a placeholder to replace with `shard(num_workers, worker_index)`.
HINT = 5; -
UNRECOGNIZED
-
-
Field Details
-
OFF_VALUE
public static final int OFF_VALUENo sharding will be performed. Each worker produces the entire dataset without any sharding. With this mode, the best practice is to shuffle the dataset nondeterministically so that workers process the dataset in different orders.
OFF = 0;- See Also:
-
DYNAMIC_VALUE
public static final int DYNAMIC_VALUEThe input dataset is dynamically split among workers at runtime. Each worker gets the next split when it reads data from the dispatcher. There is no fixed sharding with this mode.
DYNAMIC = 1;- See Also:
-
FILE_VALUE
public static final int FILE_VALUEThe following are static sharding policies. The semantics are similar to `tf.data.experimental.AutoShardPolicy`. These policies require: * The tf.data service cluster has a fixed size, and you need to specify the workers in DispatcherConfig. * Each client only reads from the local tf.data service worker. Shards by input files (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 = 2;- See Also:
-
DATA_VALUE
public static final int DATA_VALUEShards 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 = 3;- See Also:
-
FILE_OR_DATA_VALUE
public static final int FILE_OR_DATA_VALUEAttempts FILE-based sharding, falling back to DATA-based sharding on failures.
FILE_OR_DATA = 4;- See Also:
-
HINT_VALUE
public static final int HINT_VALUELooks for the presence of `shard(SHARD_HINT, ...)` which is treated as a placeholder to replace with `shard(num_workers, worker_index)`.
HINT = 5;- 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
public static Internal.EnumLiteMap<DataService.ProcessingModeDef.ShardingPolicy> internalGetValueMap() -
getValueDescriptor
- Specified by:
getValueDescriptorin interfaceProtocolMessageEnum
-
getDescriptorForType
- Specified by:
getDescriptorForTypein interfaceProtocolMessageEnum
-
getDescriptor
-
valueOf
public static DataService.ProcessingModeDef.ShardingPolicy valueOf(Descriptors.EnumValueDescriptor desc) 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
-