File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments