mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Fix view scalar bug segfault (#1603)
* fix view scalar bug * fix view scalar bug * one more fix
This commit is contained in:
@@ -4587,7 +4587,7 @@ array view(const array& a, const Dtype& dtype, StreamOrDevice s /* = {} */) {
|
||||
" axis must be a multiple of the requested type size.");
|
||||
}
|
||||
out_shape.back() /= (obytes / ibytes);
|
||||
} else {
|
||||
} else if (ibytes > obytes) {
|
||||
// Type size ratios are always integers
|
||||
out_shape.back() *= (ibytes / obytes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user