MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / forward

Method forward

timm/models/layers/selective_kernel.py:109–119  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

107 self.drop_block = drop_block
108
109 def forward(self, x):
110 if self.split_input:
111 x_split = torch.split(x, self.in_channels // self.num_paths, 1)
112 x_paths = [op(x_split[i]) for i, op in enumerate(self.paths)]
113 else:
114 x_paths = [op(x) for op in self.paths]
115 x = torch.stack(x_paths, dim=1)
116 x_attn = self.attn(x)
117 x = x * x_attn
118 x = torch.sum(x, dim=1)
119 return x

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected