MCPcopy Create free account
hub / github.com/TencentARC/MotionCtrl / noise_like

Function noise_like

lvdm/common.py:34–37  ·  view source on GitHub ↗
(shape, device, repeat=False)

Source from the content-addressed store, hash-verified

32
33
34def noise_like(shape, device, repeat=False):
35 repeat_noise = lambda: torch.randn((1, *shape[1:]), device=device).repeat(shape[0], *((1,) * (len(shape) - 1)))
36 noise = lambda: torch.randn(shape, device=device)
37 return repeat_noise() if repeat else noise()
38
39
40def default(val, d):

Callers 3

p_sampleMethod · 0.90
p_sampleMethod · 0.90
p_sample_ddimMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected