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