MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / _forward

Method _forward

sat/vae_modules/attention.py:419–431  ·  view source on GitHub ↗
(self, x, context=None, additional_tokens=None, n_times_crossframe_attn_in_self=0)

Source from the content-addressed store, hash-verified

417 return checkpoint(self._forward, (x, context), self.parameters(), self.checkpoint)
418
419 def _forward(self, x, context=None, additional_tokens=None, n_times_crossframe_attn_in_self=0):
420 x = (
421 self.attn1(
422 self.norm1(x),
423 context=context if self.disable_self_attn else None,
424 additional_tokens=additional_tokens,
425 n_times_crossframe_attn_in_self=n_times_crossframe_attn_in_self if not self.disable_self_attn else 0,
426 )
427 + x
428 )
429 x = self.attn2(self.norm2(x), context=context, additional_tokens=additional_tokens) + x
430 x = self.ff(self.norm3(x)) + x
431 return x
432
433
434class BasicTransformerSingleLayerBlock(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected