MCPcopy Create free account
hub / github.com/cactus-compute/cactus / read_node_entry

Function read_node_entry

cactus/graph/graph_io.cpp:384–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

load_graphFunction · 0.85

Calls 4

read_u32Function · 0.85
read_u32_vectorFunction · 0.85
read_size_vectorFunction · 0.85
read_op_paramsFunction · 0.85

Tested by

no test coverage detected