| 341 | } |
| 342 | |
| 343 | core::TensorValue conv1d(core::ModuleBuildContext & ctx, const core::TensorValue & x, const BackendConv1dWeights & conv) { |
| 344 | if (conv.groups == conv.in_channels && conv.out_channels == conv.in_channels) { |
| 345 | return modules::DepthwiseConv1dModule({ |
| 346 | conv.in_channels, |
| 347 | conv.kernel, |
| 348 | static_cast<int>(conv.stride), |
| 349 | static_cast<int>(conv.padding), |
| 350 | static_cast<int>(conv.dilation), |
| 351 | conv.use_bias, |
| 352 | }).build(ctx, x, conv.depthwise); |
| 353 | } |
| 354 | if (conv.groups != 1) { |
| 355 | throw std::runtime_error("TitaNet only supports regular or depthwise Conv1d groups"); |
| 356 | } |
| 357 | return modules::FastConv1dModule({ |
| 358 | conv.in_channels, |
| 359 | conv.out_channels, |
| 360 | conv.kernel, |
| 361 | static_cast<int>(conv.stride), |
| 362 | static_cast<int>(conv.padding), |
| 363 | static_cast<int>(conv.dilation), |
| 364 | conv.use_bias, |
| 365 | }, modules::FastConv1dKind::MinittsFast1dIm2col).build(ctx, x, conv.conv); |
| 366 | } |
| 367 | |
| 368 | core::TensorValue separable_conv_bn(core::ModuleBuildContext & ctx, core::TensorValue x, const BackendSeparableConvBn & layer) { |
| 369 | x = conv1d(ctx, x, layer.depthwise); |
no test coverage detected