MCPcopy Create free account
hub / github.com/LeapLabTHU/DAT / LayerNormProxy

Class LayerNormProxy

models/dat_blocks.py:413–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411 return x
412
413class LayerNormProxy(nn.Module):
414
415 def __init__(self, dim):
416
417 super().__init__()
418 self.norm = nn.LayerNorm(dim)
419
420 def forward(self, x):
421
422 x = einops.rearrange(x, 'b c h w -> b h w c')
423 x = self.norm(x)
424 return einops.rearrange(x, 'b h w c -> b c h w')
425
426
427class TransformerMLPWithConv(nn.Module):

Callers 4

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected