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

Function regular_conv_weight

src/framework/modules/streaming_conv_modules.cpp:20–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 return core::wrap_tensor(ggml_cast(ctx.ggml, value.tensor, GGML_TYPE_F32), value.shape, GGML_TYPE_F32);
19}
20
21core::TensorValue regular_conv_weight(
22 core::ModuleBuildContext & ctx,
23 const core::TensorValue & weight,
24 const char * module_name) {
25 const auto contiguous = tensor_layout::ensure_contiguous_layout_if_needed(ctx, weight);
26 if (contiguous.type == GGML_TYPE_F32 || contiguous.type == GGML_TYPE_F16) {
27 return contiguous;
28 }
29 if (contiguous.type == GGML_TYPE_BF16) {
30 return core::wrap_tensor(ggml_cast(ctx.ggml, contiguous.tensor, GGML_TYPE_F16), contiguous.shape, GGML_TYPE_F16);
31 }
32 if (ggml_is_quantized(contiguous.type)) {
33 return core::wrap_tensor(ggml_cast(ctx.ggml, contiguous.tensor, GGML_TYPE_F32), contiguous.shape, GGML_TYPE_F32);
34 }
35 throw std::runtime_error(
36 std::string(module_name) + " does not support weight type with the current ggml conv path: " +
37 ggml_type_name(contiguous.type));
38}
39
40int64_t depthwise_conv1d_output_frames(const DepthwiseConv1dConfig & config, int64_t input_frames) {

Callers 1

buildMethod · 0.70

Calls 6

wrap_tensorFunction · 0.85
ggml_castFunction · 0.85
ggml_is_quantizedFunction · 0.85
ggml_type_nameFunction · 0.85
stringFunction · 0.50

Tested by

no test coverage detected