ray.data.Dataset.randomize_block_order
ray.data.Dataset.randomize_block_order#
- Dataset.randomize_block_order(*, seed: Optional[int] = None) ray.data.dataset.Dataset[ray.data.block.T] [source]#
Randomly shuffle the blocks of this dataset.
Examples
>>> import ray >>> ds = ray.data.range(100) >>> # Randomize the block order. >>> ds.randomize_block_order() >>> # Randomize the block order with a fixed random seed. >>> ds.randomize_block_order(seed=12345)
- Parameters
seed – Fix the random seed to use, otherwise one will be chosen based on system randomness.
- Returns
The block-shuffled dataset.