contiguous op / prim (#1612)

This commit is contained in:
Awni Hannun
2024-11-21 19:51:49 -08:00
committed by GitHub
parent 0d5e7716ad
commit dcca0d7477
11 changed files with 104 additions and 25 deletions
+11
View File
@@ -4700,4 +4700,15 @@ array imag(const array& a, StreamOrDevice s /* = {} */) {
return array(a.shape(), float32, std::make_shared<Imag>(to_stream(s)), {a});
}
array contiguous(
const array& a,
bool allow_col_major /* = false */,
StreamOrDevice s /* = {} */) {
return array(
a.shape(),
a.dtype(),
std::make_shared<Contiguous>(to_stream(s), allow_col_major),
{a});
}
} // namespace mlx::core