MCPcopy Index your code
hub / github.com/huggingface/diffusers / DummyTransformer

Class DummyTransformer

tests/hooks/test_mag_cache.py:39–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38
39class DummyTransformer(ModelMixin):
40 def __init__(self):
41 super().__init__()
42 self.transformer_blocks = torch.nn.ModuleList([DummyBlock(), DummyBlock()])
43
44 def forward(self, hidden_states, encoder_hidden_states=None):
45 for block in self.transformer_blocks:
46 hidden_states = block(hidden_states, encoder_hidden_states=encoder_hidden_states)
47 return hidden_states
48
49
50class TupleOutputBlock(torch.nn.Module):

Calls

no outgoing calls

Tested by 4

test_mag_cache_resetMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…