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

Function conv1d

src/framework/modules/bigvgan_vocoder.cpp:349–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349ggml_tensor * conv1d(
350 ggml_context * ctx,
351 ggml_tensor * x,
352 const Conv1dWeights & conv,
353 const std::string & name) {
354 ggml_tensor * weight = weight_3d(ctx, conv.weight, conv.kernel, conv.in_channels, conv.out_channels, name + ".weight");
355 ggml_tensor * x3 = ggml_reshape_3d(ctx, contiguous_if_needed(ctx, x), x->ne[0], x->ne[1], 1);
356 ggml_tensor * y3 = ggml_conv_1d_fast_1d_im2col(
357 ctx,
358 weight,
359 x3,
360 static_cast<int>(conv.stride),
361 static_cast<int>(conv.padding),
362 static_cast<int>(conv.dilation));
363 ggml_tensor * y = ggml_reshape_2d(ctx, y3, y3->ne[0], y3->ne[1]);
364 if (conv.use_bias) {
365 y = ggml_add(ctx, y, weight_2d(ctx, *conv.bias, 1, conv.out_channels, name + ".bias"));
366 }
367 return named(y, name.c_str());
368}
369
370ggml_tensor * conv_transpose1d(
371 ggml_context * ctx,

Callers 2

amp_blockFunction · 0.70
build_bigvgan_graphFunction · 0.70

Calls 8

ggml_reshape_3dFunction · 0.85
ggml_reshape_2dFunction · 0.85
ggml_addFunction · 0.85
weight_3dFunction · 0.70
contiguous_if_neededFunction · 0.70
weight_2dFunction · 0.70
namedFunction · 0.70

Tested by

no test coverage detected