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

Printing Tensor on Cling prompt is broken. #47

Closed marty1885 closed 5 years ago

marty1885 commented 5 years ago

Printing the contents of tensors on cling (not ROOT) is broken for some reason. For example

▶ cling -std=c++17
[cling]$ #include <Etaler/Etaler.hpp>
[cling]$ #pragma cling load("/usr/local/lib/libEtaler.so")
[cling]$ #include <Etaler/Encoders/Scalar.hpp>
[cling]$ using namespace et;
[cling]$ auto x = encoder::scalar(0.1, 0, 1, 128, 12);
[cling]$ x
(et::Tensor &) { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}@$IDXe�O�O�XdXd��O�O��b�b��a�aU�O�O>P�P�"`�`�����������Q��@pX��������00-�D���
�������� ������1�v  .rodata1���cling-module-5!b@� 010Tecling-module-6qE0i�O_ZN13llvm_vecsmall15SmallVectorImplIlE6assignESt16initializer_listIlE
...

But it does work on ROOT (at least on 6.16.00)

▶ root -b
root [0] #include <Etaler/Etaler.hpp>
root [1] #pragma cling load("/usr/local/lib/libEtaler.so")
root [2] #include <Etaler/Encoders/Scalar.hpp>
root [3] using namespace et;
root [4] auto x = encoder::scalar(0.1, 0, 1, 128, 12);
root [5] x
(et::Tensor &) { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
marty1885 commented 5 years ago

I'm gonna build a newer version of cling and see if it is a cling bug.

marty1885 commented 5 years ago

Ahh... nevermind this sissue. It is a bug in cling.