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

Function RemoveFakeSinks

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

Source from the content-addressed store, hash-verified

59}
60
61void RemoveFakeSinks(FunctionDef* function_def) {
62 // Map from identity node names to their input tensor strings
63 std::map<string, string> identity_map;
64 for (const auto& node : function_def->node_def()) {
65 if (node.op() == "Identity" && node.input_size() == 1) {
66 identity_map[node.name()] = node.input(0);
67 }
68 }
69 for (const auto& output_arg : function_def->signature().output_arg()) {
70 const string& tensor = function_def->ret().at(output_arg.name());
71 const string& output_node = tensor.substr(0, tensor.find(':'));
72 if (identity_map.find(output_node) != identity_map.end()) {
73 (*function_def->mutable_ret())[output_arg.name()] =
74 identity_map.at(output_node);
75 }
76 }
77}
78
79Status ApplyRewrites(OpKernelContext* ctx,
80 const std::function<RewriterConfig(void)> config_factory,

Callers 1

ApplyRewritesFunction · 0.85

Calls 9

signatureMethod · 0.80
nameMethod · 0.65
node_defMethod · 0.45
opMethod · 0.45
input_sizeMethod · 0.45
inputMethod · 0.45
atMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected