MCPcopy Create free account
hub / github.com/DPS2022/diffusion-posterior-sampling / mean_flat

Function mean_flat

guided_diffusion/nn.py:86–90  ·  view source on GitHub ↗

Take the mean over all non-batch dimensions.

(tensor)

Source from the content-addressed store, hash-verified

84
85
86def mean_flat(tensor):
87 """
88 Take the mean over all non-batch dimensions.
89 """
90 return tensor.mean(dim=list(range(1, len(tensor.shape))))
91
92
93def normalization(channels):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected