Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
* Fix einsum Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hanke580 committed May 27, 2020
1 parent 3efacd2 commit 5f83e7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/operator/numpy/np_einsum_op-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,10 @@ inline void NumpyEinsumProcess(const std::vector<TBlob>& inputs,
int j = 0;
for (idim = 0; idim < ndim_iter; ++idim) {
if (op_axes_arrays[i][idim] == -1 ||
opshape[i][op_axes_arrays[i][idim]] == 1) {
(iop!=nop &&
opshape[i][op_axes_arrays[i][idim]] == 1 &&
opshape[iop][op_axes_arrays[iop][idim]] != 1)
){
remainstride[iop][j++] = iterstride[iop][idim];
} else {
opstride[iop][op_axes_arrays[i][idim]] = iterstride[iop][idim];
Expand Down

0 comments on commit 5f83e7d

Please sign in to comment.