Non-legacy equivalent of DepthConcat in PyTorch

I’m porting some Lua/Torch code over to PyTorch, which used DepthConcat.

I see that the legacy nn API provided by PyTorch provides a DepthConcat implementation – but what is the “correct” / non-legacy way to do this?

Thanks for any help.

torch.cat([A, B, C, ...], 1)

Does that work if the tensors have different sizes? Will it put zero padding?

You will need to pad them manually. F.pad is your friend http://pytorch.org/docs/master/nn.html#torch.nn.functional.pad

For what I’m doing I need to do it “automatically” as DepthConv does. Any other way?

Not that I know of, but it’s not that hard to write your own function to do that… Shouldn’t be more than 10 lines.