| 68 | } |
| 69 | |
| 70 | core::TensorValue reshape_heads( |
| 71 | core::ModuleBuildContext & ctx, |
| 72 | const core::TensorValue & input, |
| 73 | int64_t heads, |
| 74 | int64_t dim) { |
| 75 | auto contiguous = ensure_contiguous(ctx, input); |
| 76 | return core::reshape_tensor( |
| 77 | ctx, |
| 78 | contiguous, |
| 79 | core::TensorShape::from_dims({input.shape.dims[0], input.shape.dims[1], heads, dim})); |
| 80 | } |
| 81 | |
| 82 | core::TensorValue repeat_kv_heads(core::ModuleBuildContext & ctx, const core::TensorValue & input, int64_t repeats) { |
| 83 | if (repeats == 1) { |
no test coverage detected