(sample, t, *args)
| 357 | |
| 358 | def dummy_model(self): |
| 359 | def model(sample, t, *args): |
| 360 | # if t is a tensor, match the number of dimensions of sample |
| 361 | if isinstance(t, torch.Tensor): |
| 362 | num_dims = len(sample.shape) |
| 363 | # pad t with 1s to match num_dims |
| 364 | t = t.reshape(-1, *(1,) * (num_dims - 1)).to(sample.device, dtype=sample.dtype) |
| 365 | |
| 366 | return sample * t / (t + 1) |
| 367 | |
| 368 | return model |
| 369 |
no test coverage detected