rwth-i6 / pytorch-to-returnn

Make PyTorch code runnable within RETURNN
3 stars 6 forks source link

allow gathering with tensors #77

Closed vieting closed 2 years ago

vieting commented 2 years ago

I would like to allow gather a tensor with another tensor which contains integer indices which the GatherLayer should already support.

vieting commented 2 years ago

In the test case that I added, this works already. However, in the case that I'm actually interested in, the GatherLayer returns a wrong shape and I currently cannot reproduce this in a test case. There, the input is (B&Packed|57, F|768), the indices for slicing (F|5700) but the output is (F|768) instead of (5700, F|768).

Do you see some pitfalls which have to be considered here?

vieting commented 2 years ago

Btw, I think the failing test case is not related to the changes introduced in this PR, probably due to updates in RETURNN.

albertz commented 2 years ago

Btw, I think the failing test case is not related to the changes introduced in this PR, probably due to updates in RETURNN.

Can you open a separate issue for that with some details?

vieting commented 2 years ago

It's now rebased and ready for review. The issue that I mentioned above was also solved by the RETURNN related fixes.