Goal
Make OME-Arrow pixel data (from the OME struct / Parquet / Vortex) consumable by PyTorch and JAX with minimal copies by exposing a small tensor view API that can export DLPack capsules for selected slices, tiles, or batches.
Scope / Deliverables
1. Tensor View Abstraction
2. DLPack Export
3. Streaming / Batching
4. Optional Framework Shims (Nice-to-have)
Tests (Required)
1. Round-Trip Correctness (CPU)
2. Contiguity & Layout
3. Zero-Copy Expectations (CPU)
4. Error Paths
5. Iterator Semantics
Documentation (Minimal)
Acceptance Criteria
Goal
Make OME-Arrow pixel data (from the OME struct / Parquet / Vortex) consumable by PyTorch and JAX with minimal copies by exposing a small tensor view API that can export DLPack capsules for selected slices, tiles, or batches.
Scope / Deliverables
1. Tensor View Abstraction
TensorView(name flexible) returned from the OME-Arrow struct.shapedtypedevicelayout(e.g., CHW, HWC, TZCHW)strides(if applicable)CHWTZCHW2. DLPack Export
TensorView.to_dlpack(...)3. Streaming / Batching
4. Optional Framework Shims (Nice-to-have)
to_torch()thin wrapper using DLPack import utilities.to_jax()thin wrapper using DLPack import utilities.Tests (Required)
1. Round-Trip Correctness (CPU)
C=2, H=8, W=8) with known values.to_dlpack()and import into:torch.utils.dlpack.from_dlpack)jax.dlpack.from_dlpack, if available)2. Contiguity & Layout
contiguous=True, assert resulting tensor is contiguous in the consumer framework.3. Zero-Copy Expectations (CPU)
contiguous=Falsedoes not materialize when the Arrow view is already compatible.4. Error Paths
5. Iterator Semantics
iter_dlpack(batch_size=...)yields the correct number of batches.Documentation (Minimal)
Acceptance Criteria