rwth-i6 / pytorch-to-returnn

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

fix of default parameters in ConvTranspose2d #8

Closed vieting closed 3 years ago

vieting commented 3 years ago

Default parameter shapes were still 1D

albertz commented 3 years ago

We have:

_size_2_t = _scalar_or_tuple_2_t[int]

So according to the doc, this should work. Why doesn't it?

albertz commented 3 years ago

Also, I think it works like this in Torch as well. I.e. you can write ConvTransposed2d(2, 3, 4, 5). So this must work, otherwise there is some bug.

vieting commented 3 years ago

Yes, you're right. I think the problem was not in the default values but in parsing them as tuples with single entry. I removed this and added a test case. Also, I think we can remove the _single statements for the 1d transposed convolution. This is basically a duplicate of what is done in the parent class _ConvNd with _ntuple anyway.