Skip to content

Commit bee2b65

Browse files
Merge pull request #23 from foundation-ac/release/v0.1.3a3
quick updates to properly lensing batches
2 parents 8877888 + b2e220a commit bee2b65

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "atdata"
3-
version = "0.1.3a2"
3+
version = "0.1.3a3"
44
description = "A loose federation of distributed, typed datasets"
55
readme = "README.md"
66
authors = [

src/atdata/dataset.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,17 @@ def wrap_batch( self, batch: WDSRawBatch ) -> SampleBatch[ST]:
501501
"""
502502

503503
assert 'msgpack' in batch
504-
batch_unpacked = [ self.sample_type.from_bytes( bs )
505-
for bs in batch['msgpack'] ]
506-
return SampleBatch[self.sample_type]( batch_unpacked )
507504

505+
if self._output_lens is None:
506+
batch_unpacked = [ self.sample_type.from_bytes( bs )
507+
for bs in batch['msgpack'] ]
508+
return SampleBatch[self.sample_type]( batch_unpacked )
509+
510+
batch_source = [ self._output_lens.source_type.from_bytes( bs )
511+
for bs in batch['msgpack'] ]
512+
batch_view = [ self._output_lens( s )
513+
for s in batch_source ]
514+
return SampleBatch[self.sample_type]( batch_view )
508515

509516
# # @classmethod
510517
# def wrap_batch( self, batch: WDSRawBatch ) -> BT:

0 commit comments

Comments
 (0)