Add contiguous_copy_cpu util for copying array (#2397)

This commit is contained in:
Cheng
2025-07-21 23:30:35 +09:00
committed by GitHub
parent f55c4ed1d6
commit 56cc858af9
8 changed files with 17 additions and 18 deletions

View File

@@ -131,8 +131,7 @@ void Softmax::eval_cpu(const std::vector<array>& inputs, array& out) {
}
return x;
} else {
array x_copy(x.shape(), x.dtype(), nullptr, {});
copy_cpu(x, x_copy, CopyType::General, s);
array x_copy = contiguous_copy_cpu(x, s);
out.copy_shared_buffer(x_copy);
return x_copy;
}