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

Function RemoveDevice

tensorflow/tools/graph_transforms/remove_device.cc:30–41  ·  view source on GitHub ↗

Clears the device field of all ops in the graph.

Source from the content-addressed store, hash-verified

28
29// Clears the device field of all ops in the graph.
30Status RemoveDevice(const GraphDef& input_graph_def,
31 const TransformFuncContext& context,
32 GraphDef* output_graph_def) {
33 output_graph_def->Clear();
34 for (const NodeDef& node : input_graph_def.node()) {
35 NodeDef* new_node = output_graph_def->mutable_node()->Add();
36 *new_node = node;
37 new_node->set_device("");
38 }
39
40 return Status::OK();
41}
42
43REGISTER_GRAPH_TRANSFORM("remove_device", RemoveDevice);
44

Callers 1

TestRemoveDeviceMethod · 0.85

Calls 4

ClearMethod · 0.45
nodeMethod · 0.45
AddMethod · 0.45
set_deviceMethod · 0.45

Tested by 1

TestRemoveDeviceMethod · 0.68