etaler / PyEtaler

The offical Python binding for Etaler via cppyy
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Converting et.Tensor into numpy arrays using np.array creats a 32D array #4

Closed marty1885 closed 4 years ago

marty1885 commented 4 years ago

TL;DR

from etaler import et
import numpy as np
t = et.ones((4, 4))
a = np.array(t)
print(shape) # (4, 4, 1, 1..... ,1)

This is likely cause by Etaler don't have a concept of a 0D tensor (i.e. scalar). Etaler always treat scalars as 1D, length 1 tensors. Will need fix from the C++ side.

marty1885 commented 4 years ago

I've confirmed etaler/Etaler#153 solved the issue. Closing