Skip to content
fn

conv1d_op

→TensorImplPtr
int conv1d_op(const int & x, const int & W, const int & b, int stride_l, int pad_l, int dilation_l, int groups)

Python wrappers

Public Python APIs implemented by this engine symbol.

One-dimensional cross-correlation over a batch of signals.

Computes the autograd-aware op y[b,co,l]=∑ci,kx[b,ci,s l+d k]⋅W[co,ci,k]+b[co]y[b, c_o, l] = \sum_{c_i, k} x[b, c_i, s\,l + d\,k] \cdot W[c_o, c_i, k] + b[c_o] where s is the stride and d is the dilation.

Parameters

xTensorImplPtr
Input of shape (B, C_in, L).
WTensorImplPtr
Filters of shape (C_out, C_in / groups, KL).
bTensorImplPtr
Bias of shape (C_out,) or empty.
stride_lint= None
Stride along the length axis. Default: 1.
pad_lint= None
Zero-padding added to both ends of L. Default: 0.
dilation_lint= None
Kernel-element spacing along L. Default: 1.
groupsint= None
Channel grouping. Default: 1.

Returns

TensorImplPtr

Output of shape (B, C_out, L_out) where Lout=⌊(L+2p−d(KL−1)−1)/s+1⌋L_\text{out} = \lfloor (L + 2 p - d(KL - 1) - 1)/s + 1 \rfloor.