MCPcopy Index your code
hub / github.com/CompVis/diff2flow / mean_flat

Function mean_flat

diff2flow/ddpm.py:502–504  ·  view source on GitHub ↗

Take the mean over all non-batch dimensions.

(tensor)

Source from the content-addressed store, hash-verified

500
501
502def 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 """

Callers 2

_vb_terms_bpdMethod · 0.70
calc_bpd_loopMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected