apeforest commented on a change in pull request #15593: Large Index Support for
Slice
URL: https://github.com/apache/incubator-mxnet/pull/15593#discussion_r311858351
##########
File path: src/c_api/c_api.cc
##########
@@ -174,48 +174,68 @@ int MXNDArrayCreateNone(NDArrayHandle *out) {
API_END();
}
+template<typename DataType, typename dimtype>
+void CreateNDArrayImpl(const DataType* shape,
+ dimtype ndim,
+ int dev_type,
+ int dev_id,
+ int delay_alloc,
+ int dtype,
+ NDArrayHandle* out) {
+ *out = new NDArray(mxnet::TShape(shape, shape + ndim),
+
Context::Create(static_cast<Context::DeviceType>(dev_type), dev_id),
+ delay_alloc != 0, dtype);
+}
+
int MXNDArrayCreate(const mx_uint *shape,
mx_uint ndim,
int dev_type,
int dev_id,
int delay_alloc,
NDArrayHandle *out) {
API_BEGIN();
- *out = new NDArray(
- mxnet::TShape(shape, shape + ndim),
- Context::Create(static_cast<Context::DeviceType>(dev_type), dev_id),
- delay_alloc != 0);
+ *out = new NDArray(mxnet::TShape(shape, shape + ndim),
Review comment:
@access2rohit Please also use CreateNDArrayImpl as @larroy suggested.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services