Take the mean over all non-batch dimensions.
(tensor)
| 14 | |
| 15 | |
| 16 | def mean_flat(tensor): |
| 17 | """ |
| 18 | Take the mean over all non-batch dimensions. |
| 19 | """ |
| 20 | return tensor.mean(dim=list(range(1, len(tensor.shape)))) |
| 21 | |
| 22 | |
| 23 | class ModelMeanType(enum.Enum): |
no outgoing calls
no test coverage detected