MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / mean_flat

Function mean_flat

ldm/modules/diffusionmodules/util.py:195–199  ·  view source on GitHub ↗

Take the mean over all non-batch dimensions.

(tensor)

Source from the content-addressed store, hash-verified

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

Callers 1

_prior_bpdMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected