How to concate two feature(B*C*H*W) tensor together

Hello, How to concatenate two feature(1 * C * H * W) tensor together, without using extra space of GPU,
for instance, just append the second tensor B after the first tensor A, so become the output tensor(1 * 2C * H * W )
Thx!

Hi,

You can use torch.cat([t1, t2], dim=1).

1 Like

thx a lot
:+1::+1::+1::+1::+1: