Class AutoShardDataset
java.lang.Object
org.tensorflow.op.RawOp
org.tensorflow.op.data.experimental.AutoShardDataset
@Operator(group="data.experimental")
public final class AutoShardDataset
extends RawOp
implements Operand<TType>
Creates a dataset that shards the input dataset.
Creates a dataset that shards the input dataset by num_workers, returning a
sharded dataset for the index-th worker. This attempts to automatically shard
a dataset by examining the Dataset graph and inserting a shard op before the
inputs to a reader Dataset (e.g. CSVDataset, TFRecordDataset).
This dataset will throw a NotFound error if we cannot shard the dataset automatically.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classOptional attributes forAutoShardDataset -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of this op, as known by TensorFlow core engine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasOutput()Returns the symbolic handle of the tensor.static AutoShardDataset.OptionsautoShardPolicy(Long autoShardPolicy) Sets the autoShardPolicy option.static AutoShardDatasetcreate(Scope scope, Operand<? extends TType> inputDataset, Operand<TInt64> numWorkers, Operand<TInt64> index, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes, AutoShardDataset.Options... options) Factory method to create a class wrapping a new ExperimentalAutoShardDataset operation.handle()Gets handle.
-
Field Details
-
OP_NAME
The name of this op, as known by TensorFlow core engine- See Also:
-
-
Constructor Details
-
AutoShardDataset
-
-
Method Details
-
create
@Endpoint(describeByClass=true) public static AutoShardDataset create(Scope scope, Operand<? extends TType> inputDataset, Operand<TInt64> numWorkers, Operand<TInt64> index, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes, AutoShardDataset.Options... options) Factory method to create a class wrapping a new ExperimentalAutoShardDataset operation.- Parameters:
scope- current scopeinputDataset- A variant tensor representing the input dataset.numWorkers- A scalar representing the number of workers to distribute this dataset across.index- A scalar representing the index of the current worker out of num_workers.outputTypes- The value of the outputTypes attributeoutputShapes- The value of the outputShapes attributeoptions- carries optional attribute values- Returns:
- a new instance of AutoShardDataset
-
autoShardPolicy
Sets the autoShardPolicy option.- Parameters:
autoShardPolicy- the autoShardPolicy option- Returns:
- this Options instance.
-
handle
-
asOutput
Description copied from interface:OperandReturns the symbolic handle of the tensor.Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
-