MCPcopy Create free account
hub / github.com/MegaScenes/nvs / mean_flat

Function mean_flat

ldm/modules/diffusionmodules/util.py:192–196  ·  view source on GitHub ↗

Take the mean over all non-batch dimensions.

(tensor)

Source from the content-addressed store, hash-verified

190
191
192def mean_flat(tensor):
193 """
194 Take the mean over all non-batch dimensions.
195 """
196 return tensor.mean(dim=list(range(1, len(tensor.shape))))
197
198
199def normalization(channels):

Callers 3

_prior_bpdMethod · 0.90
_prior_bpdMethod · 0.90
_prior_bpdMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected