MCPcopy Create free account
hub / github.com/huggingface/diffusers / model

Method model

tests/schedulers/test_schedulers.py:359–366  ·  view source on GitHub ↗
(sample, t, *args)

Source from the content-addressed store, hash-verified

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

Calls 1

toMethod · 0.45

Tested by

no test coverage detected