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

Commit

Permalink
* Fix input out of index and rscalar of greater
Browse files Browse the repository at this point in the history
  • Loading branch information
hanke580 committed Jul 4, 2020
1 parent 7bb2a07 commit dafb139
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/api/operator/numpy/np_elemwise_broadcast_logic_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ MXNET_REGISTER_API("_npi.greater")
using namespace runtime;
const nnvm::Op* op = Op::Get("_npi_greater");
const nnvm::Op* op_scalar = Op::Get("_npi_greater_scalar");
UFuncHelper(args, ret, op, op_scalar, nullptr);
const nnvm::Op* op_rscalar = Op::Get("_npi_greater_scalar");
UFuncHelper(args, ret, op, op_scalar, op_rscalar);
});

} // namespace mxnet
7 changes: 4 additions & 3 deletions src/api/operator/numpy/np_matrix_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,11 @@ MXNET_REGISTER_API("_npi.vstack")
attrs.op = op;
SetAttrDict<op::NumpyVstackParam>(&attrs);
int num_outputs = 0;
std::vector<NDArray*> inputs;
for (int i = 0; i < param.num_args; ++i) {
inputs.push_back(args[i].operator mxnet::NDArray*());
std::vector<NDArray*> inputs_vec(args.size(), nullptr);
for (int i = 0; i < args_size; ++i) {
inputs_vec[i] = args[i].operator mxnet::NDArray*();
}
NDArray** inputs = inputs_vec.data();
auto ndoutputs = Invoke(op, &attrs, param.num_args, &inputs[0], &num_outputs, nullptr);
*ret = ndoutputs[0];
});
Expand Down

0 comments on commit dafb139

Please sign in to comment.