| 66 | }; |
| 67 | |
| 68 | static void FillInputs(const Node* n, |
| 69 | gtl::InlinedVector<const Node*, 4>* control_edges, |
| 70 | gtl::InlinedVector<std::pair<const Node*, int>, 4>* in) { |
| 71 | DCHECK_EQ(in->size(), n->num_inputs()); |
| 72 | control_edges->clear(); |
| 73 | for (const Edge* e : n->in_edges()) { |
| 74 | if (e->IsControlEdge()) { |
| 75 | control_edges->push_back(e->src()); |
| 76 | } else { |
| 77 | (*in)[e->dst_input()] = std::make_pair(e->src(), e->src_output()); |
| 78 | } |
| 79 | } |
| 80 | std::sort(control_edges->begin(), control_edges->end()); |
| 81 | if (n->op_def().is_commutative()) { |
| 82 | // For commutative inputs, we sort the input by the input Node* |
| 83 | // to get a canonical ordering (so that add(a,b) and add(b, a) will |
| 84 | // hash to the same value if is_commutative is true for 'add'). |
| 85 | std::sort(in->begin(), in->end()); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | static size_t kIllegalNodeHash = 0; |
| 90 |
no test coverage detected