(
&self,
x: &Tensor,
weight: &Tensor,
bias: Option<&Tensor>,
padding: usize,
stride: usize,
dilation: usize,
groups: usize,
)
| 608 | /// Input: `(batch, in_channels, length)`, weight: `(out_channels, in_channels/groups, kernel_size)`. |
| 609 | #[allow(clippy::too_many_arguments)] |
| 610 | fn conv1d( |
| 611 | &self, |
| 612 | x: &Tensor, |
| 613 | weight: &Tensor, |
| 614 | bias: Option<&Tensor>, |
| 615 | padding: usize, |
| 616 | stride: usize, |
| 617 | dilation: usize, |
| 618 | groups: usize, |
| 619 | ) -> Result<Tensor> { |
| 620 | let out = x.conv1d(weight, padding, stride, dilation, groups)?; |
| 621 | match bias { |
| 622 | Some(b) => { |
| 623 | let b = b.reshape((1, b.dim(0)?, 1))?; |
| 624 | out.broadcast_add(&b) |
| 625 | } |
| 626 | None => Ok(out), |
| 627 | } |
| 628 | } |
| 629 | |
| 630 | /// Transposed 1D convolution: `conv_transpose1d(x, weight) + bias`. |
| 631 | /// Matches candle_nn::ConvTranspose1d::forward() semantics. |
no outgoing calls