From 15a462e7f34776dae79908519f3e818323c035da Mon Sep 17 00:00:00 2001 From: mrava87 Date: Wed, 4 Dec 2024 20:37:04 +0300 Subject: [PATCH] bug: fix ncp.sum for cupy arrays not accepting lists --- pylops_mpi/basicoperators/VStack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylops_mpi/basicoperators/VStack.py b/pylops_mpi/basicoperators/VStack.py index 96727f7..f869a9a 100644 --- a/pylops_mpi/basicoperators/VStack.py +++ b/pylops_mpi/basicoperators/VStack.py @@ -137,7 +137,7 @@ def _rmatvec(self, x: DistributedArray) -> DistributedArray: y1 = [] for iop, oper in enumerate(self.ops): y1.append(oper.rmatvec(x.local_array[self.nnops[iop]: self.nnops[iop + 1]])) - y1 = ncp.sum(y1, axis=0) + y1 = ncp.sum(ncp.vstack(y1), axis=0) y[:] = self.base_comm.allreduce(y1, op=MPI.SUM) return y