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

Function view_batch_matrix

src/models/ace_step/vae_decoder.cpp:180–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 frames,
179 channels,
180 input.tensor->nb[1],
181 static_cast<size_t>(batch_index) * input.tensor->nb[2]);
182 return core::wrap_tensor(view, core::TensorShape::from_dims({channels, frames}), input.type);
183}
184
185core::TensorValue build_snake1d_exact_bct(
186 core::ModuleBuildContext & ctx,
187 const core::TensorValue & input,
188 const SnakeExactWeights & weights,
189 int64_t channels) {
190 const auto input_f32 = ensure_f32(ctx, ensure_contiguous_nontransposed(ctx, input));
191 auto alpha = ensure_f32(ctx, weights.alpha);
192 auto beta_inv = ensure_f32(ctx, weights.beta_inv);
193 if (alpha.shape.rank != 3 || alpha.shape.dims[0] != 1 || alpha.shape.dims[1] != channels || alpha.shape.dims[2] != 1 ||
194 beta_inv.shape.rank != 3 || beta_inv.shape.dims[0] != 1 || beta_inv.shape.dims[1] != channels || beta_inv.shape.dims[2] != 1) {
195 throw std::runtime_error("ACE-Step VAE Snake1d weight shape mismatch");
196 }
197 if (input_f32.shape.rank != 3) {

Callers 3

build_conv1dFunction · 0.70
build_conv_transpose1dFunction · 0.70

Calls 2

ggml_view_2dFunction · 0.85
wrap_tensorFunction · 0.85

Tested by

no test coverage detected