Class AutoShardDataset

java.lang.Object
org.tensorflow.op.RawOp
org.tensorflow.op.data.experimental.AutoShardDataset
All Implemented Interfaces:
Shaped, Op, Operand<TType>

@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.

  • Field Details

  • Constructor Details

    • AutoShardDataset

      public AutoShardDataset(Operation operation)
  • 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 scope
      inputDataset - 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 attribute
      outputShapes - The value of the outputShapes attribute
      options - carries optional attribute values
      Returns:
      a new instance of AutoShardDataset
    • autoShardPolicy

      public static AutoShardDataset.Options autoShardPolicy(Long autoShardPolicy)
      Sets the autoShardPolicy option.
      Parameters:
      autoShardPolicy - the autoShardPolicy option
      Returns:
      this Options instance.
    • handle

      public Output<? extends TType> handle()
      Gets handle.
      Returns:
      handle.
    • asOutput

      public Output<TType> asOutput()
      Description copied from interface: Operand
      Returns 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.

      Specified by:
      asOutput in interface Operand<TType>
      See Also: