MCPcopy
hub / github.com/ray-project/ray / ndarray_to_block

Function ndarray_to_block

python/ray/data/_internal/util.py:781–792  ·  view source on GitHub ↗
(
    ndarray: np.ndarray, ctx: DataContext
)

Source from the content-addressed store, hash-verified

779
780
781def ndarray_to_block(
782 ndarray: np.ndarray, ctx: DataContext
783) -> Tuple["Block", "BlockMetadataWithSchema"]:
784 from ray.data.block import BlockAccessor, BlockExecStats, BlockMetadataWithSchema
785
786 DataContext._set_current(ctx)
787
788 stats = BlockExecStats.builder()
789 block = BlockAccessor.batch_to_block({"data": ndarray})
790 return block, BlockMetadataWithSchema.from_block(
791 block, block_exec_stats=stats.build()
792 )
793
794
795def get_table_block_metadata_schema(

Callers

nothing calls this directly

Calls 5

_set_currentMethod · 0.80
batch_to_blockMethod · 0.80
from_blockMethod · 0.80
builderMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…