Cannot do mul for int tensors

Open
#633 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp, python

Research direction

Reproduce the failure with the provided Python test case, then inspect tensor.cc around line 932 and the Mul operator's CUDA handling for int tensors. Done means the test runs without the unknown data type error and returns the expected product for the int32 inputs.

Written by the indexing model from the issue text.

Description

Hi, @dcslin , we cannot do the mul operator for int tensors:

The error is:

F0324 05:04:22.542809 14739 tensor.cc:932] Unknown combination of data type kInt and language kCuda

please use this test case:

x1 = np.array([1], dtype=np.int32)
x2 = np.array([256], dtype=np.int32)
x1 = tensor.from_numpy(x1)
x1.to_device(gpu_dev)
x2 = tensor.from_numpy(x2)
x2.to_device(gpu_dev)

y = autograd.Mul()(x1, x2)
print(tensor.to_numpy(y[0]))
Dominant language
C++
Stars
3.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/singa

All issues in apache/singa

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.