MCPcopy Create free account
hub / github.com/Gadersd/stable-diffusion-burn / _shape

Method _shape

python/dump.py:374–375  ·  view source on GitHub ↗
(self, tensor, seq_len: int, bsz: int)

Source from the content-addressed store, hash-verified

372 self.out_proj = Linear(self.embed_dim, self.embed_dim)
373
374 def _shape(self, tensor, seq_len: int, bsz: int):
375 return tensor.reshape(bsz, seq_len, self.num_heads, self.head_dim).permute(0,2,1,3)
376
377 def __call__(self, hidden_states, causal_attention_mask):
378 bsz, tgt_len, embed_dim = hidden_states.shape

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected