Fix put_along_axis for empty arrays (#2181)

This commit is contained in:
Angelos Katharopoulos
2025-05-13 14:27:53 -07:00
committed by GitHub
parent 8f3d208dce
commit 3aa9cf3f9e
2 changed files with 10 additions and 0 deletions

View File

@@ -3175,6 +3175,10 @@ array scatter_axis(
throw std::invalid_argument(msg.str());
}
if (a.size() == 0) {
return a;
}
auto upd = astype(values, a.dtype(), s);
// Squeeze leading singletons out of update