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

Function mean_flat

ldm/util.py:57–62  ·  view source on GitHub ↗

https://github.com/openai/guided-diffusion/blob/27c20a8fab9cb472df5d6bdd6c8d11c8f430b924/guided_diffusion/nn.py#L86 Take the mean over all non-batch dimensions.

(tensor)

Source from the content-addressed store, hash-verified

55
56
57def mean_flat(tensor):
58 """
59 https://github.com/openai/guided-diffusion/blob/27c20a8fab9cb472df5d6bdd6c8d11c8f430b924/guided_diffusion/nn.py#L86
60 Take the mean over all non-batch dimensions.
61 """
62 return tensor.mean(dim=list(range(1, len(tensor.shape))))
63
64
65def count_params(model, verbose=False):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected