| 422 | } |
| 423 | |
| 424 | static void AssignSizes(const Graph& g, CostModel* cost_model) { |
| 425 | for (const Edge* e : g.edges()) { |
| 426 | // Skip if it is a control edge. |
| 427 | if (e->IsControlEdge()) { |
| 428 | continue; |
| 429 | } |
| 430 | const Node* src = e->src(); |
| 431 | |
| 432 | // TODO(josh11b): Get an estimate from the Op |
| 433 | Bytes size(1); |
| 434 | cost_model->RecordSize(src, e->src_output(), size); |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | // This generates an extremely simple initial guess for the |
| 439 | // computation cost of each node. For ordinary Ops, its value should quickly |
no test coverage detected