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

Commit 593d5b6

Browse files
ChaiBapchyaapeforest
authored andcommitted
fix template param as ndim is internally int (#17406)
* fix template param as ndim is internally int * Update c_api.cc
1 parent 09a57a6 commit 593d5b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/c_api/c_api.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,9 @@ int MXNDArrayCreateNone(NDArrayHandle *out) {
887887
API_END();
888888
}
889889

890-
template<typename DataType, typename dimtype>
890+
template<typename DataType>
891891
void CreateNDArray(const DataType* shape,
892-
dimtype ndim,
892+
int ndim,
893893
int dev_type,
894894
int dev_id,
895895
int delay_alloc,
@@ -927,7 +927,7 @@ int MXNDArrayCreateEx64(const int64_t *shape,
927927
int dtype,
928928
NDArrayHandle *out) {
929929
API_BEGIN();
930-
CreateNDArray<int64_t, int>(shape, ndim, dev_type, dev_id, delay_alloc, dtype, out);
930+
CreateNDArray<int64_t>(shape, ndim, dev_type, dev_id, delay_alloc, dtype, out);
931931
API_END();
932932
}
933933

@@ -939,7 +939,7 @@ int MXNDArrayCreateEx(const uint32_t *shape,
939939
int dtype,
940940
NDArrayHandle *out) {
941941
API_BEGIN();
942-
CreateNDArray<uint32_t, uint32_t>(shape, ndim, dev_type, dev_id, delay_alloc, dtype, out);
942+
CreateNDArray<uint32_t>(shape, static_cast<int>(ndim), dev_type, dev_id, delay_alloc, dtype, out);
943943
API_END();
944944
}
945945

0 commit comments

Comments
 (0)