This generates an extremely simple initial guess for the computation cost of each node. For ordinary Ops, its value should quickly be wiped out by the real runtime measurements. For other Ops we don't actually generate measurements, so suppression of infrequent Ops ends up giving them 0 costs. So, this is not of much consequence except perhaps in tests.
| 442 | // giving them 0 costs. So, this is not of much consequence except perhaps |
| 443 | // in tests. |
| 444 | static Microseconds TimeEstimateForNode(CostModel* cost_model, Node* n) { |
| 445 | CHECK(n->IsOp()); |
| 446 | VLOG(2) << "Node " << n->id() << ": " << n->name() |
| 447 | << " type_string: " << n->type_string(); |
| 448 | if (IsConstant(n) || IsVariable(n)) { |
| 449 | return Microseconds(0); |
| 450 | } |
| 451 | return kDefaultTimeEstimate; |
| 452 | } |
| 453 | |
| 454 | static void EstimateComputationCosts(const Graph& g, CostModel* cost_model) { |
| 455 | for (Node* n : g.nodes()) { |
no test coverage detected