MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / op_setitems

Method op_setitems

src/framework/assets/torch_bin.cpp:388–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386 stack_.back().items.push_back(std::move(value));
387 }
388 void op_setitems() {
389 const size_t mark = pop_mark();
390 std::vector<PickleValue> items(stack_.begin() + static_cast<std::ptrdiff_t>(mark), stack_.end());
391 stack_.erase(stack_.begin() + static_cast<std::ptrdiff_t>(mark), stack_.end());
392 if (stack_.empty() || stack_.back().kind != PickleValue::Kind::Dict) {
393 throw std::runtime_error("torch .bin pickle setitems without a dict");
394 }
395 for (auto & item : items) {
396 stack_.back().items.push_back(std::move(item));
397 }
398 }
399 std::vector<PickleValue> finish() {
400 const PickleValue result = pop();
401 if (result.kind != PickleValue::Kind::Dict) {

Callers

nothing calls this directly

Calls 4

beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected