Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
19
def
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
27
class
PerceiverAttention(nn.Module):
Callers
1
forward
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected