A Dataset materialized in Ray memory, e.g., via `.materialize()`. The blocks of a MaterializedDataset object are materialized into Ray object store memory, which means that this class can be shared or iterated over by multiple Ray tasks without re-executing the underlying computations f
| 7634 | |
| 7635 | @PublicAPI |
| 7636 | class MaterializedDataset(Dataset, Generic[T]): |
| 7637 | """A Dataset materialized in Ray memory, e.g., via `.materialize()`. |
| 7638 | |
| 7639 | The blocks of a MaterializedDataset object are materialized into Ray object store |
| 7640 | memory, which means that this class can be shared or iterated over by multiple Ray |
| 7641 | tasks without re-executing the underlying computations for producing the stream. |
| 7642 | """ |
| 7643 | |
| 7644 | def num_blocks(self) -> int: |
| 7645 | """Return the number of blocks of this :class:`MaterializedDataset`. |
| 7646 | |
| 7647 | Examples: |
| 7648 | >>> import ray |
| 7649 | >>> ds = ray.data.range(100).repartition(10).materialize() |
| 7650 | >>> ds.num_blocks() |
| 7651 | 10 |
| 7652 | |
| 7653 | Time complexity: O(1) |
| 7654 | |
| 7655 | Returns: |
| 7656 | The number of blocks of this :class:`Dataset`. |
| 7657 | """ |
| 7658 | return self._logical_plan.initial_num_blocks() |
| 7659 | |
| 7660 | |
| 7661 | @PublicAPI(stability="beta") |
no outgoing calls
no test coverage detected
searching dependent graphs…