Skip to content

Commit ce1502a

Browse files
Donglai Weiclaude
andcommitted
Handle None values in unstacked test batch extraction
_wrap_single_sample_value returned [None] for None mask entries, which later caused AttributeError on .device in TTA mask validation. Return None directly so downstream code correctly skips masking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 23a78a0 commit ce1502a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

connectomics/training/lightning/test_pipeline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ def _is_unstacked_test_batch(batch: Dict[str, Any]) -> bool:
155155

156156
def _wrap_single_sample_value(value: Any) -> Any:
157157
"""Convert a collated list entry back into a singleton batch value."""
158+
if value is None:
159+
return None
158160
if isinstance(value, np.ndarray):
159161
value = torch.from_numpy(value)
160162
if torch.is_tensor(value):

0 commit comments

Comments
 (0)