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

Function ~ArrayDesc

mlx/array.h:504–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502 uint32_t position{0};
503
504 explicit ArrayDesc(Shape shape, Dtype dtype);
505
506 explicit ArrayDesc(
507 Shape shape,
508 Dtype dtype,
509 std::shared_ptr<Primitive> primitive,
510 std::vector<array> inputs);
511
512 ~ArrayDesc();
513
514 private:
515 // Initialize size, strides, and other metadata
516 void init();
517 };
518
519 // The ArrayDesc contains the details of the materialized array including the
520 // shape, strides, the data type. It also includes
521 // the primitive which knows how to compute the array's data from its inputs
522 // and the list of array's inputs for the primitive.
523 std::shared_ptr<ArrayDesc> array_desc_;
524};
525
526template <typename T>
527array::array(T val, Dtype dtype /* = TypeToDtype<T>() */)
528 : array_desc_(std::make_shared<ArrayDesc>(Shape{}, dtype)) {
529 init(&val);
530}
531
532template <typename It>
533array::array(

Callers

nothing calls this directly

Calls 1

initFunction · 0.50

Tested by

no test coverage detected