MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / reshape_tensor

Function reshape_tensor

wan/models/portrait_encoder.py:19–24  ·  view source on GitHub ↗
(x, heads)

Source from the content-addressed store, hash-verified

17
18
19def reshape_tensor(x, heads):
20 bs, length, width = x.shape
21 x = x.view(bs, length, heads, -1)
22 x = x.transpose(1, 2)
23 x = x.reshape(bs, heads, length, -1)
24 return x
25
26
27class PerceiverAttention(nn.Module):

Callers 1

forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected