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

Method Initialize

tensorflow/core/grappler/utils/functions.cc:428–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426};
427
428Status MakeFunctionDefHelper::Initialize(
429 const GrapplerFunctionItem& item, const FunctionLibraryDefinition& flib) {
430 for (const InputArgInstantiation& input_arg : item.inputs()) {
431 input_nodes_.insert(input_arg.node_name);
432 }
433 for (const OutputArgInstantiation& output_arg : item.outputs()) {
434 output_nodes_.insert(output_arg.node_name);
435 }
436
437 for (const NodeDef& node : item.function_body().node()) {
438 const OpRegistrationData* registration;
439 TF_RETURN_IF_ERROR(flib.LookUp(node.op(), &registration));
440
441 tensorflow::NameRangeMap outputs_range_map;
442 TF_RETURN_IF_ERROR(tensorflow::NameRangesForNode(
443 node, registration->op_def, nullptr, &outputs_range_map));
444
445 function_body_outputs_.emplace(node.name(), std::move(outputs_range_map));
446 }
447
448 return Status::OK();
449}
450
451Status MakeFunctionDefHelper::AsFunctionDefInput(const string& graph_def_input,
452 string* func_def_input) const {

Callers 1

MakeFunctionDefFunction · 0.45

Calls 9

NameRangesForNodeFunction · 0.85
nameMethod · 0.65
inputsMethod · 0.45
insertMethod · 0.45
outputsMethod · 0.45
nodeMethod · 0.45
LookUpMethod · 0.45
opMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected