Skip to content

Commit 925a936

Browse files
committed
numpy: temporarily have shifted tensors contain a small constant
1 parent a8e8f6f commit 925a936

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

numpy/util.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ def shiftLastMode(self, tensor):
167167
for i in range(len(data)):
168168
for j in range(len(tensor.shape)):
169169
resultCoords[j][i] = coords[j][i]
170-
resultValues[i] = data[i]
170+
# resultValues[i] = data[i]
171+
# TODO (rohany): Temporarily use a constant as the value.
172+
resultValues[i] = 2
171173
resultCoords[-1][i] = (resultCoords[-1][i] + 1) % tensor.shape[-1]
172174
return sparse.COO(resultCoords, resultValues, tensor.shape)
173175

@@ -183,7 +185,9 @@ def shiftLastMode(self, tensor):
183185
for coord, val in dok.items():
184186
newCoord = list(coord[:])
185187
newCoord[-1] = (newCoord[-1] + 1) % tensor.shape[-1]
186-
result[tuple(newCoord)] = val
188+
# result[tuple(newCoord)] = val
189+
# TODO (rohany): Temporarily use a constant as the value.
190+
result[tuple(newCoord)] = 2
187191
if self.format == "csr":
188192
return scipy.sparse.csr_matrix(result)
189193
elif self.format == "csc":

0 commit comments

Comments
 (0)