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

[Unity][Relax] Support Dynamic Tensor as Index, torch frontend #15884

Merged
merged 8 commits into from
Oct 11, 2023

Conversation

guoyaol
Copy link
Contributor

@guoyaol guoyaol commented Oct 7, 2023

Add support: allow one dynamic tensor as torch.tensor's index

In Stable Diffusion XL:
e.g. output = input1 [input2.argmax(dim = -1), ]

Before: we can only support int, slice, elipsis, None
Now: we can have one dynamic torch.tensor in index, which allows us to represent SD XL correctly.

Behaviors aligns with torch.tensor:
as shown in test cases

Future TODO: Support other "fancy indexing" methods in torch.tensor, (e.g. multiple tensors as index) which requires some new relax ops

@Hzfengsy
Copy link
Member

Hzfengsy commented Oct 7, 2023

Thanks for the fix!

@guoyaol
Copy link
Contributor Author

guoyaol commented Oct 11, 2023

@junrushao @MasterJH5574

@Hzfengsy Hzfengsy merged commit bde8a87 into apache:unity Oct 11, 2023
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

Successfully merging this pull request may close these issues.

2 participants