MCPcopy Create free account
hub / github.com/colmap/colmap / ThrowCheckONNXNode

Function ThrowCheckONNXNode

src/colmap/feature/onnx_utils.cc:80–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void ThrowCheckONNXNode(const std::string_view name,
81 const std::string_view expected_name,
82 const std::vector<int64_t>& shape,
83 const std::vector<int64_t>& expected_shape) {
84 THROW_CHECK_EQ(name, expected_name);
85 THROW_CHECK_EQ(shape.size(), expected_shape.size())
86 << "Invalid shape for " << name << ": " << FormatONNXTensorShape(shape)
87 << " != " << FormatONNXTensorShape(expected_shape);
88 for (size_t i = 0; i < shape.size(); ++i) {
89 // -1 is treated as a wildcard for dynamic dimensions.
90 if (expected_shape[i] != -1) {
91 THROW_CHECK_EQ(shape[i], expected_shape[i])
92 << "Invalid shape for " << name << ": "
93 << FormatONNXTensorShape(shape)
94 << " != " << FormatONNXTensorShape(expected_shape);
95 }
96 }
97}
98
99ONNXModel::ONNXModel(std::string model_path,
100 int num_threads,

Calls 2

FormatONNXTensorShapeFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected