MCPcopy Create free account
hub / github.com/TPCD/DCCL / forward

Method forward

model/vision_transformer.py:106–114  ·  view source on GitHub ↗
(self, x, return_attention=False)

Source from the content-addressed store, hash-verified

104 self.mlp = Mlp(in_features=dim, hidden_features=mlp_hidden_dim, act_layer=act_layer, drop=drop)
105
106 def forward(self, x, return_attention=False):
107 y, attn = self.attn(self.norm1(x))
108 x = x + self.drop_path(y)
109 x = x + self.drop_path(self.mlp(self.norm2(x)))
110
111 if return_attention:
112 return x, attn
113 else:
114 return x
115
116
117class PatchEmbed(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected