MCPcopy Create free account
hub / github.com/Standard-Intelligence/hertz-dev / NonCausalResUnit

Class NonCausalResUnit

tokenizer.py:172–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170
171
172class NonCausalResUnit(nn.Module):
173 def __init__(
174 self,
175 in_channels,
176 out_channels,
177 kernel_size=7,
178 dilation=1,
179 bias=False,
180 ):
181 super().__init__()
182 self.activation = nn.ELU()
183 self.conv1 = NonCausalConv1d(
184 in_channels=in_channels,
185 out_channels=out_channels,
186 kernel_size=kernel_size,
187 stride=1,
188 dilation=dilation,
189 bias=bias,
190 )
191 self.conv2 = Conv1d1x1(out_channels, out_channels, bias)
192
193 def forward(self, x):
194 y = self.conv1(self.activation(x))
195 y = self.conv2(self.activation(y))
196 return x + y
197
198
199class CausalResUnit(NonCausalResUnit):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected