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

Method AddDevice

tensorflow/core/grappler/grappler_item.cc:148–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148Status GrapplerItem::AddDevice(const string& device) {
149 DeviceNameUtils::ParsedName name;
150
151 if (!DeviceNameUtils::ParseFullName(device, &name)) {
152 return errors::InvalidArgument("Invalid device name: device=", device);
153
154 } else if (!name.has_job || !name.has_replica || !name.has_task ||
155 !name.has_type || !name.has_id) {
156 return errors::InvalidArgument("Not a fully defined device name: device=",
157 device);
158 }
159
160 devices_.insert(DeviceNameUtils::ParsedNameToString(name));
161 return Status::OK();
162}
163
164Status GrapplerItem::AddDevices(const GrapplerItem& other) {
165 std::vector<absl::string_view> invalid_devices;

Callers 8

RunMethod · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TEST_FFunction · 0.45
InlineFunctionCallsFunction · 0.45
OptimizeGraphFunction · 0.45
ResetSessionMethod · 0.45

Calls 2

InvalidArgumentFunction · 0.85
insertMethod · 0.45

Tested by 4

TESTFunction · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36