public final class AutoShardDataset extends PrimitiveOp implements Operand<Object>
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.
operation| Modifier and Type | Method and Description |
|---|---|
Output<Object> |
asOutput()
Returns the symbolic handle of a tensor.
|
static AutoShardDataset |
create(Scope scope,
Operand<?> inputDataset,
Operand<Long> numWorkers,
Operand<Long> index,
List<Class<?>> outputTypes,
List<Shape> outputShapes)
Factory method to create a class wrapping a new AutoShardDataset operation.
|
Output<?> |
handle() |
equals, hashCode, op, toStringpublic static AutoShardDataset create(Scope scope, Operand<?> inputDataset, Operand<Long> numWorkers, Operand<Long> index, List<Class<?>> outputTypes, List<Shape> outputShapes)
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 - outputShapes - public Output<?> handle()
public Output<Object> asOutput()
OperandInputs 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.
asOutput in interface Operand<Object>OperationBuilder.addInput(Output)Copyright © 2015–2019. All rights reserved.