lanking520 commented on issue #12536: [MXNET-913][WIP] Java API --- Scala 
NDArray Improvement
URL: https://github.com/apache/incubator-mxnet/pull/12536#issuecomment-422460970
 
 
   > @lanking520 may be just printing the NDArray metadata in toString might be 
suffient
   > `(x.shape, x.size, x.dtype, x.context)`
   > 
   > * What is the use-case you are trying to solve with toString() ?
   > * I don't think you should threshold on maxLength in toArray(), it will be 
confusing. there might be genuine cases where you want to move from 
Off-Heap(NDArray) to JVM Heap(Array[Float])
   
   Hi @nswamy , the point for `toString` method is to present something similar 
to what Python ndarray have. Usually when you print a python ndarray, it will 
give you an overview of the datastructure.
   
   The reason I set a limitation there is because I am facing this issue while 
I am trying to get a `toArray` result from  a  `1000000` element NDArray. It 
reported the error that JVM memory used up when we do this kind of operation. 
In that case, user should think of reducing the dimension, slicing the array or 
even write them into files.

----------------------------------------------------------------
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