Lets say I have a tensor of [B, 1, H, W].
I want to do a 3x3 kernel search on the image, and return the max value found in that kernel so possibly [B, 1, H-1, W-1]
Similarly given [B, 3, H, W], perhaps to do the same 3x3 kernel search, but compute a special function across the 3 channels. For example, to calculate some distance functions across the 3 channels, and return the max value one.
Is there a smart tensorized way that one can achieve this?