apache / apache/singa

cannot init scalar tensor

Open
#635 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

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:
```python3
x = np.array(256, ndmin=0).astype(np.int32)
x = tensor.from_numpy(x)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.