Method
__init__
(
self,
in_channels,
out_channels,
kernel_size,
stride=1,
dilation=1,
groups=1,
bias=True
)
Source from the content-addressed store, hash-verified
| 103 | |
| 104 | class CausalConv1d(NonCausalConv1d): |
| 105 | def __init__( |
| 106 | self, |
| 107 | in_channels, |
| 108 | out_channels, |
| 109 | kernel_size, |
| 110 | stride=1, |
| 111 | dilation=1, |
| 112 | groups=1, |
| 113 | bias=True |
| 114 | ): |
| 115 | super(CausalConv1d, self).__init__( |
| 116 | in_channels=in_channels, |
| 117 | out_channels=out_channels, |
| 118 | kernel_size=kernel_size, |
| 119 | stride=stride, |
| 120 | padding=0, |
| 121 | dilation=dilation, |
| 122 | groups=groups, |
| 123 | bias=bias, |
| 124 | ) |
| 125 | self.stride = stride |
| 126 | self.pad_length = (kernel_size - 1) * dilation |
| 127 | def forward(self, x): |
| 128 | pad = nn.ConstantPad1d((self.pad_length, 0), 0.0) |
| 129 | x = pad(x) |
Callers
nothing calls this directly
Tested by
no test coverage detected