MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / conv1d

Function conv1d

src/framework/modules/titanet_runtime.cpp:343–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343core::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
368core::TensorValue separable_conv_bn(core::ModuleBuildContext & ctx, core::TensorValue x, const BackendSeparableConvBn & layer) {
369 x = conv1d(ctx, x, layer.depthwise);

Callers 4

separable_conv_bnFunction · 0.70
jasper_blockFunction · 0.70
attentive_poolFunction · 0.70
build_titanet_graphFunction · 0.70

Calls 3

FastConv1dModuleClass · 0.85
buildMethod · 0.45

Tested by

no test coverage detected