Take the mean over all non-batch dimensions.
(tensor)
| 154 | |
| 155 | |
| 156 | def mean_flat(tensor): |
| 157 | """ |
| 158 | Take the mean over all non-batch dimensions. |
| 159 | """ |
| 160 | return tensor.mean(dim=list(range(1, len(tensor.shape)))) |
| 161 | |
| 162 | |
| 163 | def normal_kl(mean1, logvar1, mean2, logvar2): |
no outgoing calls
no test coverage detected