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

Method FindDeviceFromName

tensorflow/core/common_runtime/eager/context.cc:498–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496}
497
498Status EagerContext::FindDeviceFromName(const char* device_name,
499 Device** device) const {
500 *device = HostCPU();
501 if (device_name == nullptr || strlen(device_name) == 0) {
502 return Status::OK();
503 }
504
505 auto status = local_device_mgr()->LookupDevice(device_name, device);
506 if (status.ok()) {
507 return status;
508 }
509
510 if (remote_device_mgr() != nullptr) {
511 return remote_device_mgr()->LookupDevice(device_name, device);
512 }
513
514 return status;
515}
516
517bool EagerContext::OnSameTask(const Device* first, const Device* second) const {
518 if (first == nullptr) first = HostCPU();

Callers 4

GetDeviceForInputFunction · 0.80
SendTensorMethod · 0.80

Calls 2

LookupDeviceMethod · 0.80
okMethod · 0.45

Tested by

no test coverage detected