transition
This commit is contained in:
@ -150,23 +150,6 @@ class F_x(ShapeMixin, nn.Module):
|
||||
return x
|
||||
|
||||
|
||||
class ResidualBlock(nn.Module):
|
||||
def __init__(self, fn):
|
||||
super().__init__()
|
||||
self.fn = fn
|
||||
def forward(self, x, **kwargs):
|
||||
return self.fn(x, **kwargs) + x
|
||||
|
||||
|
||||
class PreNorm(nn.Module):
|
||||
def __init__(self, dim, fn):
|
||||
super().__init__()
|
||||
self.norm = nn.LayerNorm(dim)
|
||||
self.fn = fn
|
||||
def forward(self, x, **kwargs):
|
||||
return self.fn(self.norm(x), **kwargs)
|
||||
|
||||
|
||||
class SlidingWindow(ShapeMixin, nn.Module):
|
||||
def __init__(self, in_shape, kernel, stride=1, padding=0, keepdim=False):
|
||||
super(SlidingWindow, self).__init__()
|
||||
|
Reference in New Issue
Block a user