Skip to content

Commit 45ee570

Browse files
committed
fix: update case to work with batch=1 and torch
1 parent 1c9658c commit 45ee570

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/operators/test_batch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,11 @@ def test_pinv_solver(operator, array_interface, image_data, kspace_data, optim):
235235
from mrinufft.extras.optim import loss_l2_reg
236236

237237
img, res = operator.pinv_solver(
238-
kspace_data, optim=optim, callback=loss_l2_reg, n_iter=10
238+
kspace_data, optim=optim, callback=loss_l2_reg, n_iter=5
239239
)
240240

241241
assert img.shape == operator.img_full_shape
242-
assert res[0].size == operator.n_batchs
242+
if operator.n_batchs > 1:
243+
assert len(res[0]) == operator.n_batchs
244+
else:
245+
assert res[0].ndim == 0

0 commit comments

Comments
 (0)