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

Method init

mlx/array.cpp:245–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245void array::ArrayDesc::init() {
246 strides.resize(shape.size());
247 size = 1;
248 for (int i = shape.size() - 1; i >= 0; --i) {
249 strides[i] = size;
250 size *= shape[i];
251 }
252 for (const auto& in : inputs) {
253 is_tracer |= in.is_tracer();
254 }
255}
256
257array::ArrayDesc::ArrayDesc(Shape shape, Dtype dtype)
258 : shape(std::move(shape)), dtype(dtype), status(Status::available) {

Callers

nothing calls this directly

Calls 3

is_tracerMethod · 0.80
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected