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

[Bug] ops.concat does not work the same as torch.cat #440

Closed
CBalaa opened this issue Mar 21, 2024 · 1 comment
Closed

[Bug] ops.concat does not work the same as torch.cat #440

CBalaa opened this issue Mar 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working Task Or "Story" in JIRA's term.
Milestone

Comments

@CBalaa
Copy link

CBalaa commented Mar 21, 2024

Describe the bug
ops.concat does not work the same as torch.cat on an empty tensor(shape=[0]), and this cause an Runtime error when interpreting torch.cat.

To Reproduce
The following is my code for test:

import torch
import hidet

from hidet.graph import ops
x = torch.rand([3, 4, 5])
y = torch.rand([0])
print(torch.cat([x, y]))

# x = hidet.randn([3, 4, 5])
# y = hidet.randn([0])
# print(ops.concat([x, y], axis = 0))

The hidet code report an error but torch work normally.

Expected behavior
I hope that ops.cat can do as tensor.cat does.
Or how can I custom what interpreter dose, for example, interpret torch.cat as my custome operator, but not ops.concat defaultly.

Enviroment

  • OS: Ubuntu 22.04
  • hidet version: 0.3.0
  • torch version: 2.2.1 cuda
@CBalaa CBalaa added the bug Something isn't working label Mar 21, 2024
@wangshangsam wangshangsam added the Task Or "Story" in JIRA's term. label Mar 26, 2024
@wangshangsam wangshangsam added this to the 0.5.0 milestone Aug 15, 2024
@vadiklyutiy vadiklyutiy removed their assignment Sep 25, 2024
@wangshangsam
Copy link
Collaborator

Fixed by @ZichuWu in our internal repo and will be available in our next release (end of Oct.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Task Or "Story" in JIRA's term.
Projects
None yet
Development

No branches or pull requests

5 participants