(shape, device, repeat=False)
| 32 | |
| 33 | |
| 34 | def 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 | |
| 40 | def default(val, d): |
no outgoing calls
no test coverage detected