MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CanAssignToDevice

Method CanAssignToDevice

tensorflow/core/common_runtime/placer.cc:287–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287bool 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

Callers

nothing calls this directly

Calls 4

emptyMethod · 0.45
FindDeviceByNameMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected