Skip to content

Commit

Permalink
fix R-package (apache#14536)
Browse files Browse the repository at this point in the history
  • Loading branch information
hetong007 authored and reminisce committed Apr 5, 2019
1 parent 787df7a commit 3ab14ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions R-package/src/ndarray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ Rcpp::RObject NDArrayPacker::CreateNDArrayPacker() {
}

Rcpp::Dimension NDArray::dim() const {
mx_uint ndim;
const mx_uint *pshape;
int ndim;
const int *pshape;
MX_CALL(MXNDArrayGetShape(
ptr_->handle, &ndim, &pshape));
Rcpp::IntegerVector dat(pshape, pshape + ndim);
Expand Down
18 changes: 9 additions & 9 deletions R-package/src/symbol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ Symbol::RObjectType Symbol::GetOutput(mx_uint index) const {

// helper function to convert shape into Rcpp vector
inline Rcpp::List BuildShapeData(mx_uint shape_size,
const mx_uint *shape_ndim,
const mx_uint **shape_data,
const int *shape_ndim,
const int **shape_data,
const std::vector<std::string> &names) {
Rcpp::List ret(shape_size);
for (mx_uint i = 0; i < shape_size; ++i) {
Expand All @@ -185,7 +185,7 @@ SEXP Symbol::InferShape(const Rcpp::List& kwargs) const {
<< "Need to pass parameters in key=value style.\n";
std::vector<std::string> keys = kwargs.names();
std::vector<mx_uint> arg_ind_ptr(1, 0);
std::vector<mx_uint> arg_shape_data;
std::vector<int> arg_shape_data;

for (size_t i = 0; i < kwargs.size(); ++i) {
RCHECK(keys[i].length() != 0)
Expand All @@ -197,14 +197,14 @@ SEXP Symbol::InferShape(const Rcpp::List& kwargs) const {
std::vector<const char*> c_keys = CKeys(keys);

mx_uint in_shape_size;
const mx_uint *in_shape_ndim;
const mx_uint **in_shape_data;
const int *in_shape_ndim;
const int **in_shape_data;
mx_uint out_shape_size;
const mx_uint *out_shape_ndim;
const mx_uint **out_shape_data;
const int *out_shape_ndim;
const int **out_shape_data;
mx_uint aux_shape_size;
const mx_uint *aux_shape_ndim;
const mx_uint **aux_shape_data;
const int *aux_shape_ndim;
const int **aux_shape_data;
int complete;

MX_CALL(MXSymbolInferShape(
Expand Down

0 comments on commit 3ab14ab

Please sign in to comment.