Skip to content

Commit 4b5283b

Browse files
authored
Merge pull request #121 from PyLops/bug-vstack
bug: fix ncp.sum for cupy arrays not accepting lists
2 parents 03e3a77 + 15a462e commit 4b5283b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pylops_mpi/basicoperators/VStack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _rmatvec(self, x: DistributedArray) -> DistributedArray:
137137
y1 = []
138138
for iop, oper in enumerate(self.ops):
139139
y1.append(oper.rmatvec(x.local_array[self.nnops[iop]: self.nnops[iop + 1]]))
140-
y1 = ncp.sum(y1, axis=0)
140+
y1 = ncp.sum(ncp.vstack(y1), axis=0)
141141
y[:] = self.base_comm.allreduce(y1, op=MPI.SUM)
142142
return y
143143

0 commit comments

Comments
 (0)