clj-python / libpython-clj

Python bindings for Clojure
Eclipse Public License 2.0
1.05k stars 68 forks source link

as-tensor in Usage.ml return nil instead of tensor #217

Closed behrica closed 1 year ago

behrica commented 1 year ago

https://github.com/clj-python/libpython-clj/blob/d37f06c48b75365f5dcb0dc2896cc9c3daabf89a/topics/Usage.md?plain=1#L344

(require '[libpython-clj2.python :as py])

(require '[tech.v3.tensor :refer [as-tensor]])
(py/initialize!)
(def np (py/import-module "numpy"))
(def ones-ary (py/call-attr np "ones" [2 3]))

(as-tensor ones-ary)

gives nil while Usage.ml says it should give

#tech.v2.tensor<float64>[2 3]
[[1.000 1.000 1.000]
 [1.000 1.000 1.000]]
cnuernber commented 1 year ago

Fixed in #f231642d