| 386 | } |
| 387 | tensor.stride.push_back(step.integer); |
| 388 | } |
| 389 | if (tensor.stride.size() != tensor.shape.size()) { |
| 390 | throw std::runtime_error("torch .bin pickle tensor stride does not match its shape"); |
| 391 | } |
| 392 | push(std::move(tensor)); |
| 393 | return; |
| 394 | } |
| 395 | throw std::runtime_error("torch .bin pickle reduce on an unsupported callable"); |
| 396 | } |
| 397 | void op_setitem() { |
| 398 | PickleValue value = pop(); |
| 399 | PickleValue key = pop(); |
| 400 | if (stack_.empty() || stack_.back().kind != PickleValue::Kind::Dict) { |
| 401 | throw std::runtime_error("torch .bin pickle setitem without a dict"); |