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

Method unsafe_weak_copy

mlx/array.cpp:60–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60array array::unsafe_weak_copy(const array& other) {
61 auto cpy = array(other.shape(), other.dtype(), nullptr, {});
62 cpy.set_data(
63 other.buffer(),
64 other.data_size(),
65 other.strides(),
66 other.flags(),
67 [](auto) {});
68 cpy.array_desc_->offset = other.array_desc_->offset;
69 return cpy;
70}
71
72array::array(std::initializer_list<float> data)
73 : array_desc_(

Callers

nothing calls this directly

Calls 2

set_dataMethod · 0.80
arrayFunction · 0.70

Tested by

no test coverage detected