(shape, device, repeat=False)
| 262 | |
| 263 | |
| 264 | def noise_like(shape, device, repeat=False): |
| 265 | repeat_noise = lambda: torch.randn((1, *shape[1:]), device=device).repeat(shape[0], *((1,) * (len(shape) - 1))) |
| 266 | noise = lambda: torch.randn(shape, device=device) |
| 267 | return repeat_noise() if repeat else noise() |
no test coverage detected