[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:
2026-06-02 20:57:58 +02:00
co-authored by Claude Sonnet 4.6
parent 1954064a54
commit 0b4794de4e
+1 -1
View File
@@ -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