For fusing two feature maps, which method does it faster (less memory needed) and more efficient?
Torch.cat() or Torch.stack()?
Thanks!
For fusing two feature maps, which method does it faster (less memory needed) and more efficient?
Torch.cat() or Torch.stack()?
Thanks!
Hi,
Both methods will have the exact same speed and memory footprint.
The only different is that one works with an existing dimension, while the other adds a new dimension.
You can see stack as just calling unsqueeze() on each tensor, then cat.
Thanks @albanD. It clear now!