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