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

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiyan66 committed Jul 2, 2020
1 parent 4cb2036 commit 0a38b4d
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions src/api/operator/numpy/np_elemwise_broadcast_logic_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,13 @@ MXNET_REGISTER_API("_npi.not_equal")
void SetUFuncHelper(runtime::MXNetArgs args, runtime::MXNetRetValue* ret,
const nnvm::Op* op, const nnvm::Op* op_scalar,
const nnvm::Op* op_rscalar) {
int result = 0;
if (args[1].type_code() == kNDArrayHandle) {
result++;
result <<= 1;
}
if (args[0].type_code() == kNDArrayHandle) {
result++;
}

switch (result) {
case 3 :
UFuncHelper(args, ret, op, nullptr, nullptr);
break;
case 1 :
UFuncHelper(args, ret, nullptr, op_scalar, nullptr);
break;
case 2 :
UFuncHelper(args, ret, nullptr, nullptr, op_rscalar);
break;
if (args[0].type_code() == kNDArrayHandle &&
args[1].type_code() == kNDArrayHandle) {
UFuncHelper(args, ret, op, nullptr, nullptr);
} else if (args[0].type_code() == kNDArrayHandle) {
UFuncHelper(args, ret, nullptr, op_scalar, nullptr);
} else {
UFuncHelper(args, ret, nullptr, nullptr, op_rscalar);
}
}

Expand Down

0 comments on commit 0a38b4d

Please sign in to comment.