MCPcopy Create free account
hub / github.com/ASLP-lab/SenSE / forward

Method forward

src/sense/model/backbones/dit.py:90–98  ·  view source on GitHub ↗
(self, x: float["b n d"], cond: float["b n d"], cond_noisy: float["b n d"], text_embed: float["b n d"], drop_audio_cond=False, drop_noisy_audio_cond=False)

Source from the content-addressed store, hash-verified

88 self.conv_pos_embed = ConvPositionEmbedding(dim=out_dim)
89
90 def forward(self, x: float["b n d"], cond: float["b n d"], cond_noisy: float["b n d"], text_embed: float["b n d"], drop_audio_cond=False, drop_noisy_audio_cond=False): # noqa: F722
91 if drop_audio_cond: # cfg for cond audio
92 cond = torch.zeros_like(cond)
93 if drop_noisy_audio_cond: # cfg for cond noisy audio
94 cond_noisy = torch.zeros_like(cond_noisy)
95
96 x = self.proj(torch.cat((x, cond, cond_noisy, text_embed), dim=-1))
97 x = self.conv_pos_embed(x) + x
98 return x
99
100
101# Transformer backbone using DiT blocks

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected