MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / rope_params

Function rope_params

models/transformer/wan/modules/t2m_model.py:224–231  ·  view source on GitHub ↗
(max_seq_len, dim, theta=10000)

Source from the content-addressed store, hash-verified

222
223@amp.autocast(enabled=False, device_type="cuda")
224def rope_params(max_seq_len, dim, theta=10000):
225 assert dim % 2 == 0
226 freqs = torch.outer(
227 torch.arange(max_seq_len),
228 1.0 / torch.pow(theta,
229 torch.arange(0, dim, 2).to(torch.float64).div(dim)))
230 freqs = torch.polar(torch.ones_like(freqs), freqs)
231 return freqs
232
233
234class WanRMSNorm(nn.Module):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected