Take the mean over all non-batch dimensions.
(tensor)
| 113 | |
| 114 | |
| 115 | def mean_flat(tensor): |
| 116 | """ |
| 117 | Take the mean over all non-batch dimensions. |
| 118 | """ |
| 119 | return tensor.mean(dim=list(range(1, len(tensor.shape)))) |
| 120 | |
| 121 | |
| 122 | def normalization(channels): |