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

Function load_conv1d

src/framework/modules/hift_vocoder.cpp:67–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67Conv1dWeights load_conv1d(
68 core::BackendWeightStore & store,
69 const assets::TensorSource & source,
70 const std::string & prefix,
71 int64_t out_channels,
72 int64_t in_channels,
73 int64_t kernel,
74 int64_t stride,
75 int64_t padding,
76 int64_t dilation,
77 bool use_bias,
78 assets::TensorStorageType storage_type) {
79 (void) storage_type;
80 Conv1dWeights conv;
81 conv.out_channels = out_channels;
82 conv.in_channels = in_channels;
83 conv.kernel = kernel;
84 conv.stride = stride;
85 conv.padding = padding;
86 conv.dilation = dilation;
87 conv.use_bias = use_bias;
88 conv.weight = source.require_f32(prefix + ".weight", {out_channels, in_channels, kernel});
89 conv.weight_tensor = store.make_from_f32(
90 core::TensorShape::from_dims({out_channels, in_channels, kernel}),
91 assets::TensorStorageType::F32,
92 conv.weight);
93 if (use_bias) {
94 conv.bias = source.require_f32(prefix + ".bias", {out_channels});
95 conv.bias_tensor = store.make_from_f32(core::TensorShape::from_dims({out_channels}), assets::TensorStorageType::F32, conv.bias);
96 }
97 return conv;
98}
99
100ConvTranspose1dWeights load_conv_transpose1d(
101 core::BackendWeightStore & store,

Callers 2

load_resblockFunction · 0.70
load_from_safetensorsMethod · 0.70

Calls 2

make_from_f32Method · 0.80
require_f32Method · 0.45

Tested by

no test coverage detected