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

Method UpdateEdge

tensorflow/core/graph/graph.cc:595–610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593} // namespace
594
595Status Graph::UpdateEdge(Node* new_src, int new_src_index, Node* dst,
596 int dst_index) {
597 TF_RETURN_IF_ERROR(IsValidOutputTensor(new_src, new_src_index));
598 TF_RETURN_IF_ERROR(IsValidInputTensor(dst, dst_index));
599 const Edge* e = FindEdge(dst, dst_index);
600 if (e == nullptr) {
601 return errors::InvalidArgument("Couldn't find edge to ",
602 FormatNodeForError(*dst));
603 }
604 RemoveEdge(e);
605 AddEdge(new_src, new_src_index, dst, dst_index);
606 dst->MaybeCopyOnWrite();
607 (*dst->props_->node_def.mutable_input())[dst_index] =
608 strings::StrCat(new_src->name(), ":", new_src_index);
609 return Status::OK();
610}
611
612Status Graph::AddWhileInputHack(Node* new_src, int new_src_index, Node* dst) {
613 if (!dst->IsWhileNode()) {

Callers 15

_update_inputMethod · 0.45
TESTFunction · 0.45
IntroduceJitterToTensorFunction · 0.45
TESTFunction · 0.45
CreateInductionVariableFunction · 0.45
TESTFunction · 0.45
CreateTRTNodeFunction · 0.45
UpdateMergeNodesMethod · 0.45
AddInputIdentityFunction · 0.45

Calls 8

FindEdgeFunction · 0.85
InvalidArgumentFunction · 0.85
FormatNodeForErrorFunction · 0.85
RemoveEdgeFunction · 0.85
MaybeCopyOnWriteMethod · 0.80
nameMethod · 0.65
StrCatFunction · 0.50
mutable_inputMethod · 0.45

Tested by 8

TESTFunction · 0.36
TESTFunction · 0.36
CreateInductionVariableFunction · 0.36
TESTFunction · 0.36
AddInputIdentityFunction · 0.36
AddOutputIdentitiesFunction · 0.36
TEST_FFunction · 0.36