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

Method AddDevices

tensorflow/core/grappler/grappler_item.cc:164–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164Status GrapplerItem::AddDevices(const GrapplerItem& other) {
165 std::vector<absl::string_view> invalid_devices;
166 for (const string& device : other.devices()) {
167 Status added = AddDevice(device);
168 if (!added.ok()) invalid_devices.emplace_back(device);
169 }
170 return invalid_devices.empty()
171 ? Status::OK()
172 : errors::InvalidArgument("Skipped invalid devices: [",
173 absl::StrJoin(invalid_devices, ", "),
174 "]");
175}
176
177Status GrapplerItem::InferDevicesFromGraph() {
178 absl::flat_hash_set<absl::string_view> invalid_devices;

Callers 3

TEST_FFunction · 0.45
InitGPUDevicesMethod · 0.45
GetGPUDevicesFunction · 0.45

Calls 5

InvalidArgumentFunction · 0.85
devicesMethod · 0.45
okMethod · 0.45
emplace_backMethod · 0.45
emptyMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
InitGPUDevicesMethod · 0.36
GetGPUDevicesFunction · 0.36