| 382 | } |
| 383 | |
| 384 | GraphFile::NodeEntry read_node_entry(std::istream& in) { |
| 385 | GraphFile::NodeEntry node; |
| 386 | node.index = read_u32(in); |
| 387 | uint32_t op_type_val = read_u32(in); |
| 388 | if (op_type_val > static_cast<uint32_t>(OpType::STATS_POOL)) { |
| 389 | throw std::runtime_error("Graph file corrupted: invalid op type"); |
| 390 | } |
| 391 | node.op_type = static_cast<OpType>(op_type_val); |
| 392 | node.inputs = read_u32_vector(in); |
| 393 | node.output_shape = read_size_vector(in); |
| 394 | uint32_t precision_val = read_u32(in); |
| 395 | if (precision_val > static_cast<uint32_t>(Precision::INT4)) { |
| 396 | throw std::runtime_error("Graph file corrupted: invalid precision"); |
| 397 | } |
| 398 | node.precision = static_cast<Precision>(precision_val); |
| 399 | read_op_params(in, node); |
| 400 | return node; |
| 401 | } |
| 402 | |
| 403 | |
| 404 | } // namespace |
no test coverage detected