etaler / Etaler

A flexable HTM (Hierarchical Temporal Memory) framework with full GPU support.
BSD 3-Clause "New" or "Revised" License
89 stars 14 forks source link

Print Tensor, Shape and other essential object via cling #35

Closed marty1885 closed 5 years ago

marty1885 commented 5 years ago

Cling supports printing object description when declaring/calling functions. But now useless message is printed. (Even though Etaler can pretty print via std::cout)

For example:

root [0] #pragma cling load("/usr/local/lib/libEtaler.so")
root [1] #include <Etaler/Etaler.hpp>
root [2] using namespace et;
root [3] Tensor t = ones({2,2})
(et::Tensor &) @0x7fdb47567010
root [4] cout << t << '\n';
{{ 1, 1}, 
 { 1, 1}}

It would be great if Etaler can do something like Python:

>>> import numpy as np
>>> np.ones([2,2])
array([[1., 1.],
       [1., 1.]])
marty1885 commented 5 years ago

Now printing via prompt is supported for Shape and Tensor. Fell free to reopen this issue if you need something else should be printed via prompt.