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/03/04 01:01:57 UTC

[GitHub] [incubator-mxnet] kedarbellare commented on a change in pull request #14305: [Clojure] Helper function for n-dim vector to ndarray

kedarbellare commented on a change in pull request #14305: [Clojure] Helper function for n-dim vector to ndarray
URL: https://github.com/apache/incubator-mxnet/pull/14305#discussion_r261899445
 
 

 ##########
 File path: contrib/clojure-package/src/org/apache/clojure_mxnet/util.clj
 ##########
 @@ -218,6 +218,16 @@
     (throw (ex-info error-msg
                     (s/explain-data spec value)))))
 
+(s/def ::non-empty-seq sequential?)
+(defn to-array-nd
+  "Converts any N-D sequential structure to an array
+   with the same dimensions."
+  [s]
+  (validate! ::non-empty-seq s "Invalid N-D sequence")
+  (if (sequential? (first s))
+    (to-array (map to-array-nd s))
 
 Review comment:
   done

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services