MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / forward

Method forward

diffusers/src/diffusers/models/unets/uvit_2d.py:386–403  ·  view source on GitHub ↗
(self, x, pooled_text_emb, encoder_hidden_states, cross_attention_kwargs)

Source from the content-addressed store, hash-verified

384 self.upsample = None
385
386 def forward(self, x, pooled_text_emb, encoder_hidden_states, cross_attention_kwargs):
387 if self.downsample is not None:
388 x = self.downsample(x)
389
390 for res_block, attention_block in zip(self.res_blocks, self.attention_blocks):
391 x = res_block(x, pooled_text_emb)
392
393 batch_size, channels, height, width = x.shape
394 x = x.view(batch_size, channels, height * width).permute(0, 2, 1)
395 x = attention_block(
396 x, encoder_hidden_states=encoder_hidden_states, cross_attention_kwargs=cross_attention_kwargs
397 )
398 x = x.permute(0, 2, 1).view(batch_size, channels, height, width)
399
400 if self.upsample is not None:
401 x = self.upsample(x)
402
403 return x
404
405
406class ConvNextBlock(nn.Module):

Callers

nothing calls this directly

Calls 1

downsampleMethod · 0.80

Tested by

no test coverage detected