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

fix template param as ndim is internally int #17406

Merged
merged 2 commits into from
Jan 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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