Coverage for src/flag_gems/runtime/backend/_spacemit/ops/conv1d.py: 0%
12 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-06-04 09:03 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-06-04 09:03 +0800
1import logging
3from .conv2d import conv2d
5logger = logging.getLogger(__name__)
8def conv1d(input, weight, bias=None, padding=0, stride=1, dilation=1, groups=1):
9 logger.debug("GEMS_SPACEMIT CONV1D")
11 if isinstance(stride, (list, tuple)):
12 stride_width = stride[0]
13 else:
14 stride_width = stride
16 if isinstance(padding, (list, tuple)):
17 padding_width = padding[0]
18 else:
19 padding_width = padding
20 return conv2d(
21 input.unsqueeze(-1),
22 weight.unsqueeze(-1),
23 bias,
24 (padding_width, 0),
25 (stride_width, 1),
26 dilation,
27 groups,
28 ).squeeze(-1)