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

Function graph_conv2d

src/framework/audio/zipenhancer.cpp:179–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179core::TensorValue graph_conv2d(
180 core::ModuleBuildContext & ctx,
181 const core::TensorValue & input,
182 const std::unordered_map<std::string, Param> & params,
183 const std::string & weight_name,
184 const std::string & bias_name,
185 int64_t pad_t,
186 int64_t pad_f,
187 int64_t stride_t,
188 int64_t stride_f,
189 int64_t dil_t,
190 int64_t dil_f) {
191 const auto & weight = require_param(params, weight_name);
192 const auto & bias = require_param(params, bias_name);
193 if (weight.shape.size() != 4) {
194 throw std::runtime_error("ZipEnhancer graph conv2d weight shape mismatch: " + weight_name);
195 }
196 return modules::Conv2dModule({
197 input.shape.dims[1],
198 weight.shape[0],
199 weight.shape[2],
200 weight.shape[3],
201 static_cast<int>(stride_t),
202 static_cast<int>(stride_f),
203 static_cast<int>(pad_t),
204 static_cast<int>(pad_f),
205 static_cast<int>(dil_t),
206 static_cast<int>(dil_f),
207 true,
208 }).build(ctx, input, graph_conv2d_weights(weight, bias));
209}
210
211core::TensorValue graph_instance_norm_prelu(
212 core::ModuleBuildContext & ctx,

Callers 5

graph_dense_blockFunction · 0.85
graph_dense_encoderFunction · 0.85
graph_subpixel_convFunction · 0.85
graph_mapping_decoderFunction · 0.85

Calls 4

Conv2dModuleClass · 0.85
graph_conv2d_weightsFunction · 0.85
sizeMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected