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

Method FindMatchingDevices

tensorflow/core/common_runtime/device_set.cc:41–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void DeviceSet::FindMatchingDevices(const DeviceNameUtils::ParsedName& spec,
42 std::vector<Device*>* devices) const {
43 // TODO(jeff): If we are going to repeatedly lookup the set of devices
44 // for the same spec, maybe we should have a cache of some sort
45 devices->clear();
46 for (Device* d : devices_) {
47 if (DeviceNameUtils::IsCompleteSpecification(spec, d->parsed_name())) {
48 devices->push_back(d);
49 }
50 }
51}
52
53Device* DeviceSet::FindDeviceByName(const string& name) const {
54 return gtl::FindPtrOrNull(device_by_name_, name);

Callers 5

GetDeviceAndAllocatorFunction · 0.80
GetDevicesForNodeMethod · 0.80
PinArgsAndRetsMethod · 0.80
SelectDeviceFunction · 0.80

Calls 2

clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected