python/ray/data/impl/plan.py
def _optimize(self) -> Tuple[BlockList, DatasetStats, List[Stage]]:
        """Apply stage fusion optimizations, returning an updated source block list and
        associated stats, and a set of optimized stages.
        """
        context = DatasetContext.get_current()
        blocks, stats = self._get_source_blocks()
        stages = self._stages_after_snapshot.copy()
        if context.optimize_fuse_stages:
            if context.optimize_fuse_read_stages:
                # If using a lazy datasource, rewrite read stage into one-to-one stage
                # so it can be fused into downstream stages.
                blocks, stats, stages = _rewrite_read_stages(
                    blocks, stats, stages, self._dataset_uuid
                )
            stages = _fuse_one_to_one_stages(stages)
            self._last_optimized_stages = stages
        return blocks, stats, stages
Apply stage fusion optimizations, returning an updated source block list and
        associated stats, and a set of optimized stages.
        
Apply stage fusion optimizations, returning an updated source block list and
associated stats, and a set of optimized stages.
Apply stage fusion optimizations returning an updated source block list and associated stats and a set of optimized stages .
def _optimize(self) -> Tuple[BlockList, DatasetStats, List[Stage]]:
        context = DatasetContext.get_current()
        blocks, stats = self._get_source_blocks()
        stages = self._stages_after_snapshot.copy()
        if context.optimize_fuse_stages:
            if context.optimize_fuse_read_stages:
                blocks, stats, stages = _rewrite_read_stages(
                    blocks, stats, stages, self._dataset_uuid
                )
            stages = _fuse_one_to_one_stages(stages)
            self._last_optimized_stages = stages
        return blocks, stats, stages
def _optimize ( self ) -> Tuple [ BlockList , DatasetStats , List [ Stage ] ] : context = DatasetContext . get_current ( ) blocks , stats = self . _get_source_blocks ( ) stages = self . _stages_after_snapshot . copy ( ) if context . optimize_fuse_stages : if context . optimize_fuse_read_stages : blocks , stats , stages = _rewrite_read_stages ( blocks , stats , stages , self . _dataset_uuid ) stages = _fuse_one_to_one_stages ( stages ) self . _last_optimized_stages = stages return blocks , stats , stages
Apply stage fusion optimizations, returning an updated source block list and
associated stats, and a set of optimized stages.
Apply stage fusion optimizations returning an updated source block list and associated stats and a set of optimized stages .
"""Apply stage fusion optimizations, returning an updated source block list and
        associated stats, and a set of optimized stages.
        """ # If using a lazy datasource, rewrite read stage into one-to-one stage # so it can be fused into downstream stages.
self