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

Commit

Permalink
fix template param as ndim is internally int (#17406)
Browse files Browse the repository at this point in the history
* fix template param as ndim is internally int

* Update c_api.cc
  • Loading branch information
ChaiBapchya authored and apeforest committed Jan 24, 2020
1 parent 09a57a6 commit 593d5b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,9 @@ int MXNDArrayCreateNone(NDArrayHandle *out) {
API_END();
}

template<typename DataType, typename dimtype>
template<typename DataType>
void CreateNDArray(const DataType* shape,
dimtype ndim,
int ndim,
int dev_type,
int dev_id,
int delay_alloc,
Expand Down Expand Up @@ -927,7 +927,7 @@ int MXNDArrayCreateEx64(const int64_t *shape,
int dtype,
NDArrayHandle *out) {
API_BEGIN();
CreateNDArray<int64_t, int>(shape, ndim, dev_type, dev_id, delay_alloc, dtype, out);
CreateNDArray<int64_t>(shape, ndim, dev_type, dev_id, delay_alloc, dtype, out);
API_END();
}

Expand All @@ -939,7 +939,7 @@ int MXNDArrayCreateEx(const uint32_t *shape,
int dtype,
NDArrayHandle *out) {
API_BEGIN();
CreateNDArray<uint32_t, uint32_t>(shape, ndim, dev_type, dev_id, delay_alloc, dtype, out);
CreateNDArray<uint32_t>(shape, static_cast<int>(ndim), dev_type, dev_id, delay_alloc, dtype, out);
API_END();
}

Expand Down

0 comments on commit 593d5b6

Please sign in to comment.