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

Method prefetch_if

mlx/data/Stream.cpp:119–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117 std::make_shared<stream::Prefetch>(self_, prefetch_size, num_thread));
118}
119Stream Stream::prefetch_if(bool cond, int prefetch_size, int num_thread) const {
120 if (cond) {
121 return prefetch(prefetch_size, num_thread);
122 } else {
123 return Stream(self_);
124 }
125}
126
127Stream Stream::repeat(int64_t num_time) const {
128 return Stream(std::make_shared<stream::Repeat>(self_, num_time));

Callers 1

iterateFunction · 0.80

Calls 1

StreamClass · 0.70

Tested by

no test coverage detected