Skip to content

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

Merged
Hzfengsy merged 8 commits into
apache:unityfrom
guoyaol:fix_getitem_pr
Oct 11, 2023
Merged

[Unity][Relax] Support Dynamic Tensor as Index, torch frontend#15884
Hzfengsy merged 8 commits into
apache:unityfrom
guoyaol:fix_getitem_pr

Conversation

@guoyaol
Copy link
Copy Markdown
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
Copy Markdown
Member

Hzfengsy commented Oct 7, 2023

Thanks for the fix!

@guoyaol
Copy link
Copy Markdown
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