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

Function graph_subpixel_conv

src/framework/audio/zipenhancer.cpp:839–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837}
838
839core::TensorValue graph_subpixel_conv(
840 core::ModuleBuildContext & ctx,
841 const core::TensorValue & input,
842 const std::unordered_map<std::string, Param> & params,
843 const std::string & weight_name,
844 const std::string & bias_name) {
845 auto conv = graph_conv2d(ctx, input, params, weight_name, bias_name, 0, 1, 1, 1, 1, 1);
846 if (conv.shape.dims[1] != kDense * 2) {
847 throw std::runtime_error("ZipEnhancer graph subpixel conv channel mismatch: " + weight_name);
848 }
849 auto x = graph_reshape(
850 ctx,
851 conv,
852 core::TensorShape::from_dims({conv.shape.dims[0], kDense, 2, conv.shape.dims[2] * conv.shape.dims[3]}));
853 x = graph_transpose(ctx, x, {{0, 1, 3, 2}}, 4);
854 return graph_reshape(ctx, x, core::TensorShape::from_dims({conv.shape.dims[0], kDense, conv.shape.dims[2], conv.shape.dims[3] * 2}));
855}
856
857core::TensorValue graph_mapping_decoder(
858 core::ModuleBuildContext & ctx,

Callers 2

graph_mapping_decoderFunction · 0.85

Calls 3

graph_conv2dFunction · 0.85
graph_reshapeFunction · 0.70
graph_transposeFunction · 0.70

Tested by

no test coverage detected