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

Function RewriteWhileNode

tensorflow/core/common_runtime/lower_while_op.cc:414–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412} // namespace
413
414Status RewriteWhileNode(Node* n, Graph* g,
415 bool keep_node_fetchable) {
416 VLOG(2) << "Lower While node (keep_node_fetchable=" << keep_node_fetchable
417 << "): " << SummarizeNode(*n);
418
419 const AttrValue* cond_attr = n->attrs().Find("cond");
420 if (cond_attr == nullptr) {
421 return errors::InvalidArgument("While cond function missing");
422 }
423 const AttrValue* body_attr = n->attrs().Find("body");
424 if (body_attr == nullptr) {
425 return errors::InvalidArgument("While body function missing");
426 }
427 const AttrValue* parallel_iterations_attr =
428 n->attrs().Find("parallel_iterations");
429 if (parallel_iterations_attr == nullptr) {
430 return errors::InvalidArgument("parallel_iterations attr missing");
431 }
432
433 TF_RETURN_IF_ERROR(LowerWhileHelper::Run(
434 n, cond_attr->func(), body_attr->func(), parallel_iterations_attr->i(), g,
435 keep_node_fetchable));
436 g->RemoveNode(n);
437
438 return Status::OK();
439}
440
441} // namespace tensorflow

Callers 2

InlineFunctionCallsFunction · 0.85
RunMethod · 0.85

Calls 8

InvalidArgumentFunction · 0.85
SummarizeNodeFunction · 0.50
RunFunction · 0.50
FindMethod · 0.45
attrsMethod · 0.45
funcMethod · 0.45
iMethod · 0.45
RemoveNodeMethod · 0.45

Tested by

no test coverage detected