Skip to content

Commit a6519b3

Browse files
fix the inner function (#968)
1 parent af32cbd commit a6519b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dpnp/dpnp_algo/dpnp_algo_linearalgebra.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ cpdef utils.dpnp_descriptor dpnp_inner(dpnp_descriptor array1, dpnp_descriptor a
175175
array2_lin_index_base += array2_offsets[axis] * xyz[axis2]
176176

177177
# do inner product
178-
result.get_pyobj()[idx1] = 0
178+
result.get_pyobj()[numpy.unravel_index(idx1, result.shape)] = 0
179179
for idx2 in range(array1.shape[-1]):
180-
result.get_pyobj()[idx1] += array1.get_pyobj()[array1_lin_index_base + idx2] * array2.get_pyobj()[array2_lin_index_base + idx2]
180+
result.get_pyobj()[numpy.unravel_index(idx1, result.shape)] += array1.get_pyobj()[numpy.unravel_index(array1_lin_index_base + idx2, array1.shape)] * array2.get_pyobj()[numpy.unravel_index(array2_lin_index_base + idx2, array2.shape)]
181181

182182
return result
183183

0 commit comments

Comments
 (0)