(t, repeats=None)
| 511 | |
| 512 | |
| 513 | def lazy_positional_encoding(t, repeats=None): |
| 514 | if not isinstance(t, list): |
| 515 | t = [t] |
| 516 | |
| 517 | from diffusers.models.embeddings import get_timestep_embedding |
| 518 | |
| 519 | te = torch.tensor(t) |
| 520 | te = get_timestep_embedding(timesteps=te, embedding_dim=256, flip_sin_to_cos=True, downscale_freq_shift=0.0, scale=1.0) |
| 521 | |
| 522 | if repeats is None: |
| 523 | return te |
| 524 | |
| 525 | te = te[:, None, :].expand(-1, repeats, -1) |
| 526 | |
| 527 | return te |
| 528 | |
| 529 | |
| 530 | def state_dict_offset_merge(A, B, C=None): |
nothing calls this directly
no outgoing calls
no test coverage detected