Take the mean over all non-batch dimensions.
(tensor)
| 190 | |
| 191 | |
| 192 | def mean_flat(tensor): |
| 193 | """ |
| 194 | Take the mean over all non-batch dimensions. |
| 195 | """ |
| 196 | return tensor.mean(dim=list(range(1, len(tensor.shape)))) |
| 197 | |
| 198 | |
| 199 | def normalization(channels): |