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

Method SlidingWindow

mlx/data/stream/SlidingWindow.cpp:10–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace data {
9namespace stream {
10SlidingWindow::SlidingWindow(
11 const std::shared_ptr<Stream>& stream,
12 const std::string& key,
13 int64_t size,
14 int64_t stride,
15 int dim,
16 const std::string& index_key)
17 : stream_(stream),
18 key_(key),
19 size_(size),
20 stride_(stride),
21 dim_(dim),
22 index_key_(index_key) {
23 if (size <= 0) {
24 throw std::runtime_error("SlidingWindow: size must be strictly positive");
25 }
26 if (stride <= 0) {
27 throw std::runtime_error("SlidingWindow: stride must be strictly positive");
28 }
29}
30
31Sample SlidingWindow::next() const {
32 std::unique_lock lock(mutex_);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected