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

Method MakeNodeImage

tensorflow/compiler/jit/encapsulate_subgraphs_pass.cc:443–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441}
442
443Node* Encapsulator::Subgraph::MakeNodeImage(const Graph* graph_in, Node* node) {
444 if (!graph_) {
445 graph_.reset(new Graph(graph_in->op_registry()));
446 graph_->set_versions(graph_in->versions());
447 }
448
449 // TODO(b/116981129): Enhance how the device for the encapsulated subgraph is
450 // determined. In case of hard placement, ensure all the encapsulated nodes
451 // have the same requested device, which in turn will be the requested device
452 // for the entire encapsulated subgraph. In case of soft placement, use a
453 // deterministic approach to fill in the requested device. Handle co-location
454 // constraints similarly if they exist.
455 if (device_.empty()) {
456 device_ = node->assigned_device_name().empty()
457 ? node->requested_device()
458 : node->assigned_device_name();
459 }
460
461 return graph_->CopyNode(node);
462}
463
464Graph* Encapsulator::Subgraph::GetGraph() const { return graph_.get(); }
465

Callers 1

CopySubgraphNodesMethod · 0.45

Calls 6

set_versionsMethod · 0.80
CopyNodeMethod · 0.80
resetMethod · 0.45
op_registryMethod · 0.45
versionsMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected