mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-15 09:29:26 +08:00
Fixes output donation for IO ops on the GPU (#1857)
This commit is contained in:
committed by
GitHub
parent
0a5215693e
commit
0145911bea
@@ -76,6 +76,18 @@ array::array(allocator::Buffer data, Shape shape, Dtype dtype, Deleter deleter)
|
||||
set_data(data, deleter);
|
||||
}
|
||||
|
||||
array::array(
|
||||
allocator::Buffer data,
|
||||
Shape shape,
|
||||
Dtype dtype,
|
||||
Strides strides,
|
||||
size_t data_size,
|
||||
Flags flags,
|
||||
Deleter deleter)
|
||||
: array_desc_(std::make_shared<ArrayDesc>(std::move(shape), dtype)) {
|
||||
set_data(data, data_size, std::move(strides), flags, deleter);
|
||||
}
|
||||
|
||||
void array::detach() {
|
||||
for (auto& s : array_desc_->siblings) {
|
||||
s.array_desc_->inputs.clear();
|
||||
|
||||
Reference in New Issue
Block a user