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

Function graph_upsample_slice

src/framework/audio/zipenhancer.cpp:752–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

750}
751
752core::TensorValue graph_upsample_slice(
753 core::ModuleBuildContext & ctx,
754 const core::TensorValue & input,
755 int64_t factor,
756 int64_t target) {
757 std::vector<core::TensorValue> pieces;
758 pieces.reserve(static_cast<size_t>(input.shape.dims[0] * factor));
759 for (int64_t s = 0; s < input.shape.dims[0]; ++s) {
760 auto slice = modules::SliceModule({0, s, 1}).build(ctx, input);
761 for (int64_t k = 0; k < factor; ++k) {
762 pieces.push_back(slice);
763 }
764 }
765 auto out = graph_concat_all(ctx, pieces, 0);
766 if (out.shape.dims[0] != target) {
767 out = modules::SliceModule({0, 0, target}).build(ctx, out);
768 }
769 return out;
770}
771
772core::TensorValue graph_run_dual_encoder(
773 core::ModuleBuildContext & ctx,

Callers 1

Calls 3

SliceModuleClass · 0.85
graph_concat_allFunction · 0.85
buildMethod · 0.45

Tested by

no test coverage detected