ankkhedia commented on issue #12546: How to subset a MXNDArray in R?
URL: 
https://github.com/apache/incubator-mxnet/issues/12546#issuecomment-421159408
 
 
   Hi @liqg Thanks for the question. 
   
   You  will need to convert the mx objects to R supported arrays and use that 
to subset.
   ```python
   library(mxnet)
   a <- mx.nd.ones(10)
   b<-as.array(a)
   b[1]
   [1] 1
   b[1:2]
   [1] 1 1
   
   features <- mx.nd.random.normal(scale=1, shape=c(100, 2))
   c<-as.array(features)
   c[1,1]
   [1] -0.7248557
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to