| 285 | } |
| 286 | |
| 287 | bool Placer::CanAssignToDevice(const string& candidate_device_name, |
| 288 | const std::vector<Device*>& devices) const { |
| 289 | if (!candidate_device_name.empty()) { |
| 290 | // 'devices' lists the set of devices that the placer or the user has |
| 291 | // constrained the operation to. "candidate_device_name" must |
| 292 | // refer to a concrete Device that is in the list of 'devices'. |
| 293 | const Device* other_device = |
| 294 | devices_->FindDeviceByName(candidate_device_name); |
| 295 | if (std::find(devices.begin(), devices.end(), other_device) != |
| 296 | devices.end()) { |
| 297 | return true; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | return false; |
| 302 | } |
| 303 | |
| 304 | } // namespace tensorflow |
nothing calls this directly
no test coverage detected