fix copies in sdpa (#2563)

This commit is contained in:
Awni Hannun
2025-09-02 11:00:36 -07:00
committed by GitHub
parent 04cbb4191c
commit b61a65e313
2 changed files with 12 additions and 1 deletions

View File

@@ -394,7 +394,7 @@ void ScaledDotProductAttention::eval_gpu(
// Define some copy functions to ensure the layout of the inputs is as
// expected.
copies.reserve(3);
copies.reserve(inputs.size());
auto copy_unless = [&copies, &s](
auto predicate, const array& arr) -> const array& {
if (!predicate(arr)) {