[fix] use np.asnumpy in SubImageCombine to support CuPy arrays
_np.asarray() raises TypeError on CuPy arrays; np.asnumpy() handles both. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,7 +68,7 @@ class SubImageCombine:
|
||||
|
||||
for ix in range(nx):
|
||||
for iy in range(ny):
|
||||
patch = _np.asarray(np.reshape(subimages[ix * ny + iy], (self.n_ch, self.sx, self.sy)))
|
||||
patch = np.asnumpy(np.reshape(subimages[ix * ny + iy], (self.n_ch, self.sx, self.sy)))
|
||||
x0, y0 = ix * self.px, iy * self.py
|
||||
accum[:, x0:x0+self.sx, y0:y0+self.sy] += patch
|
||||
count[0, x0:x0+self.sx, y0:y0+self.sy] += 1.0
|
||||
|
||||
Reference in New Issue
Block a user