| 21 | namespace tensorflow { |
| 22 | |
| 23 | Status InstantiateFunctionForTest(const string& name, |
| 24 | const FunctionLibraryDefinition& library, |
| 25 | InstantiationResultForTest* result) { |
| 26 | const FunctionDef* fdef = library.Find(name); |
| 27 | TF_RET_CHECK(fdef != nullptr); |
| 28 | |
| 29 | auto get_func_sig = [&library](const string& op, const OpDef** sig) { |
| 30 | return library.LookUpOpDef(op, sig); |
| 31 | }; |
| 32 | InstantiationResult inst; |
| 33 | TF_RETURN_IF_ERROR( |
| 34 | InstantiateFunction(*fdef, AttrSlice(), get_func_sig, &inst)); |
| 35 | result->arg_types = inst.arg_types; |
| 36 | result->ret_types = inst.ret_types; |
| 37 | for (NodeDef& n : inst.nodes) { |
| 38 | *result->gdef.add_node() = std::move(n); |
| 39 | } |
| 40 | return Status::OK(); |
| 41 | } |
| 42 | |
| 43 | } // namespace tensorflow |
no test coverage detected