Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[Clojure] follow up pr 14531 to fix tests #14565

Merged
merged 1 commit into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions contrib/clojure-package/test/dev/generator_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,17 @@
(is (= "LRN" (-> lrn-info vals ffirst :name str)))))

(deftest test-symbol-vector-args
;; FIXME
#_(is (= `(if (clojure.core/map? kwargs-map-or-vec-or-sym)
(is (= '(if (clojure.core/map? kwargs-map-or-vec-or-sym)
(util/empty-list)
(util/coerce-param
kwargs-map-or-vec-or-sym
#{"scala.collection.Seq"}))
kwargs-map-or-vec-or-sym
#{"scala.collection.Seq"}))
(gen/symbol-vector-args))))

(deftest test-symbol-map-args
;; FIXME
#_(is (= `(if (clojure.core/map? kwargs-map-or-vec-or-sym)
(is (= '(if (clojure.core/map? kwargs-map-or-vec-or-sym)
(org.apache.clojure-mxnet.util/convert-symbol-map
kwargs-map-or-vec-or-sym)
kwargs-map-or-vec-or-sym)
nil)
(gen/symbol-map-args))))

Expand Down Expand Up @@ -160,14 +158,13 @@
:exception-types [],
:flags #{:public}}]}
function-name (symbol "div")]
;; FIXME
#_(is (= '(([sym sym-or-Object]
(is (= '(([sym sym-or-object]
(util/coerce-return
(.$div
sym
(util/nil-or-coerce-param
sym-or-Object
#{"org.apache.mxnet.Symbol" "java.lang.Object"})))))
(.$div
sym
(util/nil-or-coerce-param
sym-or-object
#{"org.apache.mxnet.Symbol" "java.lang.Object"})))))
(gen/gen-symbol-function-arity op-name op-values function-name)))))

(deftest test-gen-ndarray-function-arity
Expand Down Expand Up @@ -210,5 +207,4 @@
fname)
good-contents (slurp "test/good-test-ndarray.clj")
contents (slurp fname)]
;; FIXME
#_(is (= good-contents contents)))))
(is (= good-contents contents)))))
1 change: 1 addition & 0 deletions contrib/clojure-package/test/good-test-ndarray.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
ndarray-or-double-or-float
#{"org.apache.mxnet.MX_PRIMITIVES$MX_PRIMITIVE_TYPE"
"org.apache.mxnet.NDArray"})))))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#nitpick do we need this extra line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in the generator - not needed but we can tackle that in another PR touching that area.

Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@
d-shape1 [10 3 64 64]
d-shape2 [10 3 32 32]
l-shape [10]

mod (m/module my-sym {:data-names ["data1" "data2"]})
data-batch {:data [(ndarray/random-uniform 0 9 (str (mx-shape/->shape d-shape1)))
(ndarray/random-uniform 5 15 (str (mx-shape/->shape d-shape2)))]
Expand Down Expand Up @@ -280,9 +281,8 @@
:index nil
:pad 0}]
(-> mod
(m/forward data-batch))
;; FIXME
#_(is (= [(first l-shape) num-class]
(m/forward data-batch-2))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome catch!

(is (= [(first l-shape) num-class]
(-> mod
(m/outputs-merged)
(first)
Expand All @@ -301,9 +301,8 @@
:index nil
:pad 0}]
(-> mod
(m/forward data-batch))
;; FIXME
#_(is (= [(first l-shape) num-class]
(m/forward data-batch-2))
(is (= [(first l-shape) num-class]
(-> mod
(m/outputs-merged)
(first)
Expand Down