How is the efficiency when doing computation with Tensor of [w,h] or [1, w*h]?

Hi, guys,
I am implementing the computation of mIoU in semantic segmentation,
and I want to know how is the efficiency when doing computation with Tensor of [w,h] or [1, w*h]?
Because this would help me decide whether I need to tranform the Tensor into a 1-dimension Tensor before I do the mIoU computation.

Any idea or answer will be appreciated!
Thanks in advance!

I would recommend to run a quick profiling code and just get the runtimes for your current workload and setup. :wink:

Also, if you are using the GPU, don’t forget to synchronize the code via torch.cuda.synchronize().

1 Like