| 44 | constexpr char kDelimiter[] = "@@"; |
| 45 | |
| 46 | void 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 | |
| 61 | void RemoveFakeSinks(FunctionDef* function_def) { |
| 62 | // Map from identity node names to their input tensor strings |
no test coverage detected