samskalicky commented on a change in pull request #17569: Adding sparse support
to MXTensor for custom operators
URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r392018268
##########
File path: include/mxnet/lib_api.h
##########
@@ -393,13 +458,21 @@ class OpResource {
return static_cast<mx_stream_t>(cuda_stream);
}
+ void alloc_ndarray(MXSparse* sparse, int index, int indices_len, int
indptr_len = 0) {
+ ndarray_malloc(ndarray_alloc, index, indices_len, indptr_len,
+ &(sparse->data), &(sparse->indices), &(sparse->indptr));
+ }
+
private:
/*! \brief allocation lambda function */
xpu_malloc_t cpu_malloc, gpu_malloc;
/*! \brief lambda function to return allocated memory handle */
void *cpu_alloc, *gpu_alloc;
/*! \brief cuda stream passed from MXNet */
void *cuda_stream;
+
+ ndarray_malloc_t ndarray_malloc;
Review comment:
how about sparse_malloc_t sparse_malloc?
----------------------------------------------------------------
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