Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot init scalar tensor #635

Open
joddiy opened this issue Mar 24, 2020 · 0 comments
Open

cannot init scalar tensor #635

joddiy opened this issue Mar 24, 2020 · 0 comments

Comments

@joddiy
Copy link
Member

joddiy commented Mar 24, 2020

Hi, @dcslin , since some onnx models need scalar-tensor but we can't support.

The error is:

Traceback (most recent call last):
File "../../test/python/test_operation.py", line 4015, in test_tmp
x = tensor.from_numpy(x)
File "/usr/local/lib/python3.5/dist-packages/singa/tensor.py", line 766, in from_numpy
ret.copy_from_numpy(np_array)
File "/usr/local/lib/python3.5/dist-packages/singa/tensor.py", line 307, in copy_from_numpy
assert np_array.size == self.size(), 'tensor shape should be the same'
AssertionError: tensor shape should be the same

please use this test case:

x = np.array(256, ndmin=0).astype(np.int32)
x = tensor.from_numpy(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant