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/02/27 22:57:14 UTC

[GitHub] gigasquid opened a new issue #14271: [Clojure] Add helper function to convert formed vector to NDArray (infers shape)

gigasquid opened a new issue #14271: [Clojure] Add helper function to convert formed vector to NDArray (infers shape)
URL: https://github.com/apache/incubator-mxnet/issues/14271
 
 
   We have a ndarray function called `array` that will take a 1d clojure vector and a shape vector and turn it into a ndarray. The Scala function has a new helper function that allows you to pass in a dimensional float/double  array and have the NDArray create it and infer the shape.
   
   It would be nice to create an interop function for this.
   Example of interop:
   
   ```clojure
   user=> (def x [[1.0 2.0 3.0] [4.0 5.0 6.0]])
   #'user/x
   user=> (NDArray/toNDArray (to-array (mapv #(to-array %) x)) nil)
   #object[org.apache.mxnet.NDArray 0x382169db "[\n [1.0,2.0,3.0]\n [4.0,5.0,6.0]\n]\n<NDArray (2,3) cpu(0) float64>"]
   user=> 
   ```
   
   

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