uncomplicate / deep-diamond

A fast Clojure Tensor & Deep Learning library
https://aiprobook.com
Eclipse Public License 1.0
428 stars 17 forks source link

NPE occurs when printing tensors if *print-length* is nil. #21

Closed jjttjj closed 4 months ago

jjttjj commented 1 year ago

Not a high priority issue but I hit this and figured I would log it here.

I believe *print-length* defaults to nil in clojure, but some of the print methods in deep-diamond depend on it being set or they throw an NPE. For example, here: https://github.com/uncomplicate/deep-diamond/blob/41913bf930bad92f8341ad679459827ac61ebf93/src/clojure/uncomplicate/diamond/internal/dnnl/tensor.clj#L521

blueberry commented 1 year ago

Thanks. I'll see to fix it in the next release.

matthewdowney commented 1 year ago

Just hit this also, I think this was the cause in #9 too.

behrica commented 4 months ago

same for me. I am poking arrround , still blindly, in deep diamond, but could not print my tensors, geeting NPEs

Now i see of course, having learned from #22 , That the "hello world" projects sets print-length

I would still think , that code should work even without having any of these set: https://github.com/uncomplicate/deep-diamond/blob/9d6c9bf4411d998243c82c2c62426c6ad497a994/project.clj#L22

blueberry commented 4 months ago

Fixed in the newest snapshot.