This is an improvement that looks more _idiomatic_. Our current approach is to 
remember to call `.dispose` on those `NDArray` objects we create, something 
like:
```clojure
(let [a (ndarray/ones [3])
      b (ndarray/ones [3])
      result (ndarray/+ a b)]
  (doseq [nd a]
    (.dispose ^NDArray nd))
  (doseq [nd b]
    (.dispose ^NDArray nd))
  result)
```
With some discipline you can remember to do it, however our current main issues 
are `NDArray` objects created at the Scala API that we can't _reach_ and call 
`.dispose` on them.


[ Full content available at: 
https://github.com/apache/incubator-mxnet/pull/12447 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to