| 55 | auto repeated = core::wrap_tensor(ggml_repeat(ctx.ggml, bias_view.tensor, output_contiguous.tensor), output.shape, GGML_TYPE_F32); |
| 56 | return core::wrap_tensor(ggml_add(ctx.ggml, output_contiguous.tensor, repeated.tensor), output.shape, GGML_TYPE_F32); |
| 57 | } |
| 58 | |
| 59 | core::TensorValue zeros_like_prefix( |
| 60 | core::ModuleBuildContext & ctx, |
| 61 | const core::TensorValue & input, |
| 62 | int64_t prefix_frames) { |
| 63 | auto prefix = RepeatModule({core::TensorShape::from_dims({input.shape.dims[0], input.shape.dims[1], prefix_frames})}) |
| 64 | .build(ctx, SliceModule({2, 0, 1}).build(ctx, input)); |
| 65 | auto prefix_contiguous = tensor_layout::ensure_contiguous_layout_if_needed(ctx, prefix); |
| 66 | return core::wrap_tensor(ggml_scale(ctx.ggml, prefix_contiguous.tensor, 0.0f), prefix.shape, GGML_TYPE_F32); |
| 67 | } |
| 68 |
no test coverage detected