MCPcopy Index your code
hub / github.com/ray-project/ray / MaterializedDataset

Class MaterializedDataset

python/ray/data/dataset.py:7636–7658  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

7634
7635@PublicAPI
7636class 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")

Callers 9

from_blocksFunction · 0.90
from_itemsFunction · 0.90
from_pandas_refsFunction · 0.90
from_numpy_refsFunction · 0.90
from_arrow_refsFunction · 0.90
materializeMethod · 0.90
splitMethod · 0.85
split_at_indicesMethod · 0.85
materializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…