Take the sum over all non-batch dimensions.
(tensor)
| 91 | return tensor.mean(dim=list(range(1, len(tensor.shape)))) |
| 92 | |
| 93 | def sum_flat(tensor): |
| 94 | """ |
| 95 | Take the sum over all non-batch dimensions. |
| 96 | """ |
| 97 | return tensor.sum(dim=list(range(1, len(tensor.shape)))) |
| 98 | |
| 99 | |
| 100 | def normalization(channels): |