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

Method set_data

mlx/array.cpp:168–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void array::set_data(allocator::Buffer buffer, Deleter d) {
169 array_desc_->data = std::make_shared<Data>(buffer, d);
170 array_desc_->offset = 0;
171 array_desc_->data_size = size();
172 array_desc_->flags.contiguous = true;
173 array_desc_->flags.row_contiguous = true;
174 auto max_dim = std::max_element(shape().begin(), shape().end());
175 array_desc_->flags.col_contiguous = size() <= 1 || size() == *max_dim;
176}
177
178void array::set_data(
179 allocator::Buffer buffer,

Callers 15

unsafe_weak_copyMethod · 0.80
eval_gpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
svd_implFunction · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80
eval_cpuMethod · 0.80

Calls 4

sizeFunction · 0.85
shapeFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected