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

Function snake_beta

src/models/miocodec/graph_ops.cpp:690–704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688 auto input = core::ensure_backend_addressable_layout(ctx, input_bct);
689 auto alpha = core::reshape_tensor(ctx, weights.alpha, core::TensorShape::from_dims({1, input_bct.shape.dims[1], 1}));
690 auto inv_beta = core::reshape_tensor(ctx, weights.inv_beta, core::TensorShape::from_dims({1, input_bct.shape.dims[1], 1}));
691 auto alpha_rep = core::wrap_tensor(ggml_repeat(ctx.ggml, alpha.tensor, input.tensor), input.shape, GGML_TYPE_F32);
692 auto inv_beta_rep = core::wrap_tensor(ggml_repeat(ctx.ggml, inv_beta.tensor, input.tensor), input.shape, GGML_TYPE_F32);
693 auto ax = engine::modules::MulModule{}.build(ctx, input, alpha_rep);
694 ax = core::ensure_backend_addressable_layout(ctx, ax);
695 auto periodic = core::wrap_tensor(ggml_sqr(ctx.ggml, ggml_sin(ctx.ggml, ax.tensor)), input.shape, GGML_TYPE_F32);
696 periodic = engine::modules::MulModule{}.build(ctx, periodic, inv_beta_rep);
697 return core::wrap_tensor(ggml_add(ctx.ggml, input.tensor, periodic.tensor), input.shape, GGML_TYPE_F32);
698}
699
700core::TensorValue upsampler(
701 core::ModuleBuildContext & ctx,
702 const core::TensorValue & input_bct,
703 const MioCodecUpsamplerWeights & weights,
704 int64_t groups,
705 const std::vector<core::TensorValue> * stage_time_masks,
706 const std::vector<core::TensorValue> * stage_inv_valid_group_values) {
707 auto x = input_bct;

Callers 1

upsamplerFunction · 0.70

Calls 8

reshape_tensorFunction · 0.85
wrap_tensorFunction · 0.85
ggml_repeatFunction · 0.85
ggml_mulFunction · 0.85
ggml_sqrFunction · 0.85
ggml_sinFunction · 0.85
ggml_addFunction · 0.85

Tested by

no test coverage detected