MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / mean_flat

Function mean_flat

Large-DiT-ImageNet/diffusion/gaussian_diffusion.py:16–20  ·  view source on GitHub ↗

Take the mean over all non-batch dimensions.

(tensor)

Source from the content-addressed store, hash-verified

14
15
16def mean_flat(tensor):
17 """
18 Take the mean over all non-batch dimensions.
19 """
20 return tensor.mean(dim=list(range(1, len(tensor.shape))))
21
22
23class ModelMeanType(enum.Enum):

Callers 4

_vb_terms_bpdMethod · 0.70
training_lossesMethod · 0.70
_prior_bpdMethod · 0.70
calc_bpd_loopMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected