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

Function AddFakeSinks

tensorflow/core/kernels/data/dataset_utils.cc:46–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44constexpr char kDelimiter[] = "@@";
45
46void AddFakeSinks(FunctionDef* function_def) {
47 int counter = 0;
48 for (const auto& output : function_def->signature().output_arg()) {
49 NodeDef* node = function_def->add_node_def();
50 tensorflow::grappler::function_utils::SetUniqueFunctionNodeName(
51 strings::StrCat("FakeSink", counter++), function_def, node);
52 node->set_op("Identity");
53 node->add_input(function_def->ret().at(output.name()));
54 (*node->mutable_attr())["T"].set_type(output.type());
55
56 (*function_def->mutable_ret())[output.name()] =
57 strings::StrCat(node->name(), ":output:0");
58 }
59}
60
61void RemoveFakeSinks(FunctionDef* function_def) {
62 // Map from identity node names to their input tensor strings

Callers 1

ApplyRewritesFunction · 0.85

Calls 8

signatureMethod · 0.80
set_opMethod · 0.80
nameMethod · 0.65
typeMethod · 0.65
StrCatFunction · 0.50
add_inputMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected