https://github.com/openai/guided-diffusion/blob/27c20a8fab9cb472df5d6bdd6c8d11c8f430b924/guided_diffusion/nn.py#L86 Take the mean over all non-batch dimensions.
(tensor)
| 55 | |
| 56 | |
| 57 | def 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 | |
| 65 | def count_params(model, verbose=False): |
nothing calls this directly
no outgoing calls
no test coverage detected