| 422 | // node, the field will be cleared in the diff. |
| 423 | template <typename GraphViewT> |
| 424 | inline void UpdateDevice(NodeViewDiff<GraphViewT>* diff, |
| 425 | absl::string_view device) { |
| 426 | if (diff->graph_view->GetNode(diff->node_index)->GetDevice() == device) { |
| 427 | diff->device.clear(); |
| 428 | diff->update_device = false; |
| 429 | } else { |
| 430 | diff->device = string(device); |
| 431 | diff->update_device = true; |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | // Adds or updates value in vector `v` at index `i`. This will also resize the |
| 436 | // vector if index `i` is out of bounds, padding the vector with |