MCPcopy Create free account
hub / github.com/ml-explore/mlx / detach

Method detach

mlx/array.cpp:116–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void array::detach() {
117 array_desc_->primitive = nullptr;
118 for (auto& s : array_desc_->siblings) {
119 s.array_desc_->primitive = nullptr;
120 }
121 for (auto& s : array_desc_->siblings) {
122 s.array_desc_->inputs.clear();
123 s.array_desc_->siblings.clear();
124 s.array_desc_->position = 0;
125 }
126 array_desc_->inputs.clear();
127 array_desc_->siblings.clear();
128 array_desc_->position = 0;
129}
130
131bool array::is_available() const {
132 if (status() == Status::available) {

Callers 3

eval_implFunction · 0.45
mainFunction · 0.45

Calls 1

clearMethod · 0.45

Tested by 2

mainFunction · 0.36