I’m not sure, why you get this output shape, as the docs explain dim1 should be computed as:
 num_ang_bins * num_spatial_bins ** 2

which would be 8*4**2=128.
CC @edgarriba
It also seems that the inplace docs might not be up to date, as the input is given as:

Input: (B, 1, num_spatial_bins, num_spatial_bins)

while I would assume it should be:

Input: (B, 1, patch_size, patch_size)