Skip to content

Commit 32ae0ed

Browse files
committed
Make 2D FB tests FFB friendly
Cast `Images` to arrays when needed.
1 parent 7266d57 commit 32ae0ed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_FBbasis2D.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,9 @@ def testGaussianExpand(self):
401401
coef = self.basis.expand(im1)
402402
im2 = self.basis.evaluate(coef)
403403

404+
if isinstance(im2, Image):
405+
im2 = im2.asnumpy()
406+
404407
# For small L there's too much clipping at high freqs to get 1e-3
405408
# accuracy.
406409
if self.L < 32:
@@ -457,6 +460,8 @@ def testEvaluateExpand(self):
457460
coef1 = coef1.astype(self.dtype)
458461

459462
im = self.basis.evaluate(coef1)
463+
if isinstance(im, Image):
464+
im = im.asnumpy()
460465
coef2 = self.basis.expand(im)[:, 0]
461466

462467
self.assertTrue(np.allclose(coef1, coef2, atol=utest_tolerance(self.dtype)))
@@ -466,6 +471,8 @@ def testAdjoint(self):
466471
u = u.astype(self.dtype)
467472

468473
Au = self.basis.evaluate(u)
474+
if isinstance(Au, Image):
475+
Au = Au.asnumpy()
469476

470477
x = randn(*self.basis.sz, seed=self.seed)
471478
x = x.astype(self.dtype)

0 commit comments

Comments
 (0)