| 61 | } |
| 62 | |
| 63 | core::TensorValue reshape_heads( |
| 64 | core::ModuleBuildContext & ctx, |
| 65 | const core::TensorValue & input, |
| 66 | int64_t heads, |
| 67 | int64_t dim) { |
| 68 | const auto contiguous = core::ensure_backend_addressable_layout(ctx, input); |
| 69 | return core::reshape_tensor( |
| 70 | ctx, |
| 71 | contiguous, |
| 72 | core::TensorShape::from_dims({input.shape.dims[0], input.shape.dims[1], heads, dim})); |
| 73 | } |
| 74 | |
| 75 | core::TensorValue repeat_kv_heads(core::ModuleBuildContext & ctx, const core::TensorValue & input, int64_t repeats) { |
| 76 | if (repeats == 1) { |
no test coverage detected