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 2018/01/02 21:30:43 UTC

[GitHub] eric-haibin-lin commented on issue #9211: mx.io.NDArrayIter with scipy.sparse, last batch becomes dense and with no warning upfront

eric-haibin-lin commented on issue #9211: mx.io.NDArrayIter with scipy.sparse, last batch becomes dense and with no warning upfront
URL: https://github.com/apache/incubator-mxnet/issues/9211#issuecomment-354880292
 
 
   Hi @dingran 
   I just noticed that you're using gluon interface with sparse ndarray. Unfortunately this is not supported yet. The gluon interface will try to run all operators with dense data/weight/gradient if you hybridize it. You probably will observe storage fallback messages in your console/terminal. 
   
   If you don't hybridize the network, you can probably run it in imperative mode (I haven't verify it personally, so there's no guarantee that it works without any conversion between sparse and dense ndarrays..). Note that the `nn.Dense` layer uses `FullyConnected` operator, which doesn't support csr inputs (due to legacy operator interface that doesn't support sparse, we're fixing it). So it's actually converting everything into dense to perform the operation. Instead you can create a custom layer with sparse.dot operator which supports csr input to replace `nn.Dense` (note that the weight is transposed in FC though). 
   
   Gluon sparse support is on the roadmap. Currently the easiest way to use the sparse feature is still through the symbol interface (unfortunately) 
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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