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

Method forward

models/dat_blocks.py:121–127  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

119 self.register_buffer("attn_mask", attn_mask)
120
121 def forward(self, x):
122
123 shifted_x = torch.roll(x, shifts=(-self.shift_size, -self.shift_size), dims=(2, 3))
124 sw_x, _, _ = super().forward(shifted_x, self.attn_mask)
125 x = torch.roll(sw_x, shifts=(self.shift_size, self.shift_size), dims=(2, 3))
126
127 return x, None, None
128
129
130class DAttentionBaseline(nn.Module):

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected