Take the mean over all non-batch dimensions.
(tensor)
| 500 | |
| 501 | |
| 502 | def mean_flat(tensor): |
| 503 | """ Take the mean over all non-batch dimensions. """ |
| 504 | return tensor.mean(dim=list(range(1, len(tensor.shape)))) |
| 505 | |
| 506 | |
| 507 | """ Helpers for NLL computation """ |
no outgoing calls
no test coverage detected