I am trying to find the average of a tensor (b, c, h, w), which would transform it to (b, c, 1, 1). It is the same as average pooling and can be performed with adaptivepool.
However, I am trying to exclude all zeros in the average calculation. Is there any way to do this?