MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / mean_flat

Function mean_flat

mogen/models/utils/gaussian_diffusion.py:165–169  ·  view source on GitHub ↗

Take the mean over all non-batch dimensions.

(tensor)

Source from the content-addressed store, hash-verified

163
164
165def mean_flat(tensor):
166 """
167 Take the mean over all non-batch dimensions.
168 """
169 return tensor.mean(dim=list(range(1, len(tensor.shape))))
170
171
172def normal_kl(mean1, logvar1, mean2, logvar2):

Callers 4

_vb_terms_bpdMethod · 0.85
training_lossesMethod · 0.85
_prior_bpdMethod · 0.85
calc_bpd_loopMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected