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

Class CausalResUnit

tokenizer.py:199–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197
198
199class CausalResUnit(NonCausalResUnit):
200 def __init__(
201 self,
202 in_channels,
203 out_channels,
204 kernel_size=7,
205 dilation=1,
206 bias=False,
207 ):
208 super(CausalResUnit, self).__init__(
209 in_channels=in_channels,
210 out_channels=out_channels,
211 kernel_size=kernel_size,
212 dilation=dilation,
213 bias=bias,
214 )
215 self.conv1 = CausalConv1d(
216 in_channels=in_channels,
217 out_channels=out_channels,
218 kernel_size=kernel_size,
219 stride=1,
220 dilation=dilation,
221 bias=bias,
222 )
223
224 def inference(self, x):
225 y = self.conv1.inference(self.activation(x))
226 y = self.conv2(self.activation(y))
227 return x + y
228
229
230class ResNetBlock(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected