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

Method next

python/src/array.cpp:82–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80 }
81
82 mx::array next() {
83 if (idx_ >= x_.shape(0)) {
84 throw nb::stop_iteration();
85 }
86
87 if (idx_ >= 0 && idx_ < splits_.size()) {
88 return mx::squeeze(splits_[idx_++], 0);
89 }
90
91 return *(x_.begin() + idx_++);
92 }
93
94 private:
95 int idx_;

Callers

nothing calls this directly

Calls 3

squeezeFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected