You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/10/23 20:45:03 UTC

[GitHub] [incubator-mxnet] haojin2 edited a comment on issue #16596: How to initialize a CPU tensor in custom cu file?

haojin2 edited a comment on issue #16596: How to initialize a CPU tensor in custom cu file?
URL: https://github.com/apache/incubator-mxnet/issues/16596#issuecomment-545628138
 
 
   @vasusingla619 If you're asking how to create a temporary CPU memory space in a .cu file, you can simply do this:
   ```c++
   void YourFunction(...) {
       // Your code
       vector<char> temp_buffer(workspace_size * 5, 0);
       Tensor<cpu, 1, char> workspace(temp_buffer.data(), Shape1(workspace * 5));
       // Your code
   }
   ```
   Lemme know if this solves your question.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services