| 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 | |
| 185 | core::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) { |
no test coverage detected