kedarbellare commented on issue #14813: [Clojure] Remove unneeded test files
URL: https://github.com/apache/incubator-mxnet/pull/14813#issuecomment-487426417
 
 
   +1 to adding the `test-*` files to `.gitignore`. i did the same with the 
`ndarray-api` files. 
   
   For the `NDArrayRandomAPI` part, it took some time but you can do something 
like:
   ```clojure
   (import '(org.apache.mxnet NDArrayOrScalar))
   
   ;; this calls random_exponential
   (util/coerce-return
     (NDArrayRandomAPI/exponential
       (util/->option 1.0) ; lam
       (util/->option (mx-shape/->shape [2 1])) ; shape
       (util/->option nil) ; ctx
       (util/->option nil) ; dtype
       (util/->option nil) ; out
       (NDArrayOrScalar. true) ; input lambda is ndarray or scalar?
       nil ; class type
     ))
   ;; returns 2 x 1 randomly sampled ndarray
   
   ;; this calls sample_exponential (concurrent sampling)
   (util/coerce-return
     (NDArrayRandomAPI/exponential
       (util/->option (ndarray/ones [3])) ; lam
       (util/->option (mx-shape/->shape [2 1])) ; shape
       (util/->option nil) ; ctx
       (util/->option nil) ; dtype
       (util/->option nil) ; out
       (NDArrayOrScalar. false) ; input lambda is ndarray or scalar?
       nil ; class type
     ))
   ;; returns 3 x 2 x 1 concurrently sampled ndarray
   ```
   you can ignore my comment about unifying random/sample or come up with the 
clojure way of doing this (e.g. using `defmulti` and `defmethod`).
   
   doing it in a subsequent PR is fine by me :smiley: 

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


With regards,
Apache Git Services

Reply via email to