MCPcopy Create free account
hub / github.com/ai-techsystems/deepC / sanityCheck

Method sanityCheck

src/graph/graph.cpp:33–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33bool dnnc::graph::sanityCheck() {
34 bool result = true;
35 for (node *n : _nodes) {
36 std::vector<node *> next_level_nodes;
37 if (false == n->inputNodes(*this, next_level_nodes)) {
38 if (n->ntype() != node::INPUT && n->symbol() != opConstant) {
39 std::cerr << "ERROR (GRAPH): some of graph " + _name + "'s node " +
40 n->name() + "'s\n";
41 std::cerr << " outputs are not connected to other nodes "
42 "in the graph.\n";
43 result = false;
44 }
45 }
46 if (false == n->outputNodes(*this, next_level_nodes)) {
47 if (n->ntype() != node::OUTPUT) {
48 std::cerr << "ERROR (GRAPH): some of graph " + _name + "'s node " +
49 n->name() + "'s\n";
50 std::cerr << " inputs are not connected to other nodes "
51 "in the graph.\n";
52 result = false;
53 }
54 }
55 }
56 return result;
57}
58
59#ifdef DNNC_GRAPH_TEST
60using namespace dnnc;

Callers 1

mainMethod · 0.80

Calls 5

inputNodesMethod · 0.45
ntypeMethod · 0.45
symbolMethod · 0.45
nameMethod · 0.45
outputNodesMethod · 0.45

Tested by

no test coverage detected