Skip to content

Commit 451c207

Browse files
committed
convert scalar array to tensor
Signed-off-by: Arthur Dujardin <[email protected]>
1 parent c438fe0 commit 451c207

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monai/data/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ def decollate_batch(batch, detach: bool = True, pad=True, fill_value=None):
626626
):
627627
return batch
628628
if isinstance(batch, np.ndarray) and batch.ndim == 0:
629-
return batch.item() if detach else batch
629+
batch = torch.from_numpy(batch)
630630
if isinstance(batch, torch.Tensor):
631631
if detach:
632632
batch = batch.detach()

0 commit comments

Comments
 (0)