Home
last modified time | relevance | path

Searched refs:fdef (Results 1 – 25 of 127) sorted by relevance

123456

/external/tensorflow/tensorflow/core/framework/
Dfunction_test.cc71 auto fdef = FDH::Create( in TEST() local
99 EXPECT_EQ(DebugString(fdef), e); in TEST()
104 InstantiateFunction(fdef, Attrs({{"T", DT_FLOAT}}), GetOpSig, &result)); in TEST()
118 auto fdef = FDH::Create( in TEST() local
146 EXPECT_EQ(DebugString(fdef), e); in TEST()
149 InstantiateFunction(fdef, Attrs({{"T", DT_FLOAT}}), GetOpSig, &result)); in TEST()
176 auto fdef = FDH::Create( in TEST() local
203 EXPECT_EQ(DebugString(fdef), e); in TEST()
208 InstantiateFunction(fdef, Attrs({{"T", DT_FLOAT}}), GetOpSig, &result)); in TEST()
222 auto fdef = FDH::Create( in TEST() local
[all …]
Dgraph_to_functiondef.cc160 FunctionDef* fdef) { in FillFunctionBody() argument
162 for (const auto& func_attr : fdef->signature().attr()) { in FillFunctionBody()
169 NodeDef* node_def = fdef->add_node_def(); in FillFunctionBody()
251 fdef->mutable_signature()->set_is_stateful(true); in FillFunctionBody()
285 OpDef::AttrDef* attr_def = fdef->mutable_signature()->add_attr(); in FillFunctionBody()
298 const std::vector<string>& output_names, FunctionDef* fdef) { in GraphToFunctionDefHelper() argument
362 /*description=*/nullptr, fdef); in GraphToFunctionDefHelper()
377 const char* description, FunctionDef* fdef) { in GraphToFunctionDef() argument
383 fdef->mutable_signature()->set_description(description); in GraphToFunctionDef()
407 OpDef::ArgDef* argdef = fdef->mutable_signature()->add_output_arg(); in GraphToFunctionDef()
[all …]
Dfunction.cc597 string Print(const FunctionDef& fdef) { in Print() argument
599 const OpDef& sig = fdef.signature(); in Print()
625 for (const auto& n : fdef.node_def()) { in Print()
628 for (const auto& cr : fdef.control_ret()) { in Print()
631 for (const auto& r : fdef.ret()) { in Print()
737 Status InstantiateFunction(const FunctionDef& fdef, AttrSlice attr_values, in InstantiateFunction() argument
741 const auto& signature = fdef.signature(); in InstantiateFunction()
746 for (const auto& line : str_util::Split(Print(fdef), '\n')) { in InstantiateFunction()
751 const OpDef& sig = fdef.signature(); in InstantiateFunction()
757 (fdef.attr().count(FunctionLibraryDefinition::kIntsOnDeviceAttr) != 0 && in InstantiateFunction()
[all …]
Dgraph_to_functiondef_test.cc72 FunctionDef fdef; in TEST() local
73 TF_EXPECT_OK(GraphToFunctionDef(*graph, "test_fn", &fdef)); in TEST()
91 EqualFunctionDef(fdef_expected, RemoveDebugInfo(fdef), &diff); in TEST()
109 FunctionDef fdef; in TEST() local
110 TF_EXPECT_OK(GraphToFunctionDef(*graph, "test_fn", &fdef)); in TEST()
125 EqualFunctionDef(fdef_expected, RemoveDebugInfo(fdef), &diff); in TEST()
148 FunctionDef fdef; in TEST() local
149 TF_EXPECT_OK(GraphToFunctionDef(*graph, "test_fn", control_ret, &fdef)); in TEST()
165 EqualFunctionDef(fdef_expected, RemoveDebugInfo(fdef), &diff); in TEST()
Dgraph_to_functiondef.h41 const char* description, FunctionDef* fdef);
54 FunctionDef* fdef);
57 FunctionDef* fdef);
61 FunctionDef* fdef);
64 const string& function_name, AttrSlice attrs, const FunctionDef* fdef,
/external/tensorflow/tensorflow/python/framework/
Dfunction_def_to_graph_test.py48 fdef = graph_to_function_def.graph_to_function_def(
53 fdef.signature.name = "_whats_in_a_name"
54 return fdef
58 fdef = self._build_function_def()
59 g = function_def_to_graph.function_def_to_graph(fdef)
68 fdef = self._build_function_def()
70 g = function_def_to_graph.function_def_to_graph(fdef)
77 fdef,
88 fdef, input_shapes=[None, tensor_shape.TensorShape([5, 7])])
98 fdef, input_shapes=[tensor_shape.TensorShape([5, 7])])
[all …]
Dfunction_def_to_graph.py34 def function_def_to_graph(fdef, argument
63 func_graph = FuncGraph(fdef.signature.name,
67 input_shapes_attr = fdef.attr.get("_input_shapes", None)
76 fdef.signature.input_arg):
83 fdef, input_shapes)
93 nested_to_flat_tensor_name[arg.name] for arg in fdef.signature.input_arg
101 nested_to_flat_tensor_name[fdef.ret[arg.name]]
102 for arg in fdef.signature.output_arg
108 func_graph.get_operation_by_name(fdef.control_ret[ret_name])
109 for ret_name in fdef.signature.control_output
[all …]
/external/tensorflow/tensorflow/compiler/jit/
Dxla_kernel_creator_test.cc70 for (const auto& fdef : flib) { in Init() local
71 *(proto.add_function()) = fdef; in Init()
99 FunctionDef fdef = XTimesY(); in TEST_F() local
100 (*fdef.mutable_attr())["_XlaMustCompile"] = BoolAttr(true); in TEST_F()
101 Init({fdef}); in TEST_F()
128 FunctionDef fdef = XTimesY(); in TEST_F() local
129 Init({fdef}); in TEST_F()
144 FunctionDef fdef = XTimesY(); in TEST_F() local
145 (*fdef.mutable_attr())["_XlaMustCompile"] = BoolAttr(false); in TEST_F()
146 Init({fdef}); in TEST_F()
/external/tensorflow/tensorflow/python/saved_model/
Dfunction_deserialization.py346 library_function_names = set(fdef.signature.name for fdef in library.function)
380 for fdef in library.function:
381 function_deps[fdef.signature.name] = _list_function_deps(
382 fdef, library_function_names, library_gradient_names)
385 for fdef in _sort_function_defs(library, function_deps):
386 orig_name = _fix_fdef_in_place(fdef, functions, load_shared_name_suffix,
417 fdef,
435 if "_input_shapes" in fdef.attr:
436 del fdef.attr["_input_shapes"]
437 func = function_lib.ConcreteFunction(func_graph, attrs=fdef.attr)
[all …]
/external/tensorflow/tensorflow/core/common_runtime/
Dfunction_def_utils.cc30 const FunctionDef& fdef, const AttrSlice& attrs, in FunctionDefToBodyHelper() argument
36 TF_RETURN_IF_ERROR(InstantiateFunction(fdef, attrs, get_func_sig, &result)); in FunctionDefToBodyHelper()
40 auto construction_context_iter = fdef.attr().find("_construction_context"); in FunctionDefToBodyHelper()
41 if (construction_context_iter != fdef.attr().end()) { in FunctionDefToBodyHelper()
56 lib_def->GetStackTraces(fdef.signature().name()); in FunctionDefToBodyHelper()
71 *fbody = std::make_unique<FunctionBody>(fdef, result.arg_types, in FunctionDefToBodyHelper()
76 Status FunctionDefToBodyHelper(const FunctionDef& fdef, const AttrSlice& attrs, in FunctionDefToBodyHelper() argument
82 return FunctionDefToBodyHelper(fdef, attrs, lib_def, get_func_sig, fbody); in FunctionDefToBodyHelper()
Dlower_function_call_op.cc67 const FunctionDef* fdef; in RewriteFunctionCallNode() local
71 fdef = flib_def.Find(func.name()); in RewriteFunctionCallNode()
76 fdef = flib_def.Find(n->type_string()); in RewriteFunctionCallNode()
79 if (fdef == nullptr) { in RewriteFunctionCallNode()
85 FunctionDefToBodyHelper(*fdef, n->attrs(), &flib_def, &fbody)); in RewriteFunctionCallNode()
/external/tensorflow/tensorflow/core/grappler/optimizers/data/
Dnoop_elimination.cc80 bool IsOutputIdentityOfInput(const FunctionDef& fdef, const string& output_arg, in IsOutputIdentityOfInput() argument
82 if (!fdef.ret().contains(output_arg)) { in IsOutputIdentityOfInput()
88 const auto& ret_val = fdef.ret().at(output_arg); in IsOutputIdentityOfInput()
93 while (function_utils::ContainsFunctionNodeWithName(input.node_name, fdef)) { in IsOutputIdentityOfInput()
94 int idx = function_utils::FindFunctionNodeWithName(input.node_name, fdef); in IsOutputIdentityOfInput()
96 const NodeDef& node = fdef.node_def(idx); in IsOutputIdentityOfInput()
122 const FunctionDef* fdef = in IsMapIdentity() local
126 if (function_utils::IsFunctionStateful(function_library, *fdef)) return false; in IsMapIdentity()
128 const auto& sig = fdef->signature(); in IsMapIdentity()
133 if (!IsOutputIdentityOfInput(*fdef, sig.output_arg(i).name(), in IsMapIdentity()
Dslack_test.cc116 FunctionDef *fdef = lib_def.add_function(); in TEST() local
117 fdef->mutable_signature()->set_name("nested_function"); in TEST()
118 auto *input_arg = fdef->mutable_signature()->add_input_arg(); in TEST()
121 auto *output_arg = fdef->mutable_signature()->add_output_arg(); in TEST()
124 fdef->mutable_signature()->set_is_stateful(true); in TEST()
134 fdef); in TEST()
140 fdef); in TEST()
148 {std::make_pair("T", variant_type_attr)}, fdef); in TEST()
150 (*fdef->mutable_ret())["identity"] = in TEST()
152 (*fdef->mutable_control_ret())[tensor_dataset_node->name()] = in TEST()
[all …]
Dfunction_utils.cc91 FunctionDef* fdef, DataType dtype) { in AddFunctionOutputWithUniqueName() argument
93 int id = fdef->signature().output_arg_size(); in AddFunctionOutputWithUniqueName()
94 while (ContainsFunctionOutputWithName(name, *fdef)) { in AddFunctionOutputWithUniqueName()
98 auto* output = fdef->mutable_signature()->mutable_output_arg()->Add(); in AddFunctionOutputWithUniqueName()
102 (*fdef->mutable_ret())[name] = string(output_tensor_name); in AddFunctionOutputWithUniqueName()
105 OpDef_ArgDef* AddFunctionInput(const string& name, FunctionDef* fdef, in AddFunctionInput() argument
107 auto* input_arg = fdef->mutable_signature()->mutable_input_arg()->Add(); in AddFunctionInput()
/external/tensorflow/tensorflow/c/
Dc_api_function_test.cc229 FunctionDef fdef() { in fdef() function in tensorflow::__anond63916200111::CApiFunctionTest
230 tensorflow::FunctionDef fdef; in fdef() local
231 EXPECT_TRUE(GetFunctionDef(func_, &fdef)); in fdef()
232 return fdef; in fdef()
252 void VerifyFDefNodes(const tensorflow::FunctionDef& fdef, in VerifyFDefNodes() argument
254 ASSERT_EQ(nodes.size(), fdef.node_def_size()) in VerifyFDefNodes()
257 << "] Actual nodes in fdef: " << fdef.DebugString(); in VerifyFDefNodes()
258 for (const NodeDef& node_def : fdef.node_def()) { in VerifyFDefNodes()
261 << " in fdef: " << fdef.DebugString(); in VerifyFDefNodes()
265 void VerifyFDefInputs(const tensorflow::FunctionDef& fdef, in VerifyFDefInputs() argument
[all …]
Dc_api_function.cc213 control_output_names_vec, description, &tf_function->fdef); in TF_GraphToFunctionWithControlOutputs()
241 return func->fdef.signature().name().c_str(); in TF_FunctionName()
255 *fdef_lib.add_function() = func->fdef; in TF_GraphCopyFunction()
257 *fdef_lib.add_function() = grad->fdef; in TF_GraphCopyFunction()
259 gdef->set_function_name(func->fdef.signature().name()); in TF_GraphCopyFunction()
260 gdef->set_gradient_func(grad->fdef.signature().name()); in TF_GraphCopyFunction()
282 func->fdef = lib.function(i); in TF_GraphGetFunctions()
291 status->status = MessageToBuffer(func->fdef, output_func_def); in TF_FunctionToFunctionDef()
297 if (!func->fdef.ParseFromArray(proto, proto_len)) { in TF_FunctionImportFunctionDef()
317 (*func->fdef.mutable_attr())[string(attr_name)] = attr_value; in TF_FunctionSetAttrValueProto()
[all …]
/external/tensorflow/tensorflow/core/tfrt/utils/
Dgraph_partition_test.cc178 for (const FunctionDef& fdef : new_graphdef.library().function()) { in TEST_F() local
181 ASSERT_TRUE(fdef.attr().contains(tensorflow::kNoInlineAttr)); in TEST_F()
182 EXPECT_TRUE(fdef.attr().at(tensorflow::kNoInlineAttr).b()); in TEST_F()
184 func_name_to_func[fdef.signature().name()] = fdef; in TEST_F()
190 const FunctionDef& fdef = in TEST_F() local
194 ASSERT_TRUE(fdef.attr().contains("device")); in TEST_F()
195 if (fdef.attr().at("device").s() == device0_->name()) { in TEST_F()
197 } else if (fdef.attr().at("device").s() == device1_->name()) { in TEST_F()
206 for (const NodeDef& node : fdef.node_def()) { in TEST_F()
Dtfrt_graph_execution_state_test.cc342 auto fdef = tensorflow::FunctionDefHelper::Create( in TEST_F() local
349 *fdef_lib.add_function() = fdef; in TEST_F()
356 fdef.signature().output_arg(0).type()}; in TEST_F()
358 func_attr.set_name(fdef.signature().name()); in TEST_F()
399 auto fdef = tensorflow::FunctionDefHelper::Create( in TEST_F() local
416 *fdef_lib.add_function() = fdef; in TEST_F()
423 fdef.signature().output_arg(0).type()}; in TEST_F()
425 func_attr.set_name(fdef.signature().name()); in TEST_F()
584 auto fdef = tensorflow::FunctionDefHelper::Create( in TEST_F() local
591 *fdef_lib.add_function() = fdef; in TEST_F()
[all …]
/external/tensorflow/tensorflow/python/ops/
Dcontrol_flow_util_v2.py190 fdef = functions[func_name].definition
191 output_arg_name = fdef.signature.output_arg[output_idx].name
192 output_tensor_name = fdef.ret[output_arg_name]
194 output_tensor_name, [arg.name for arg in fdef.signature.input_arg],
195 {ndef.name: ndef for ndef in fdef.node_def}, functions)
298 fdef = None
304 fdef = func.definition
311 if fdef is None:
322 fdef, input_shapes)
/external/tensorflow/tensorflow/c/eager/
Dgraph_function.cc20 GraphFunction::GraphFunction(FunctionDef fdef) in GraphFunction() argument
21 : AbstractFunction(kGraph), fdef_(fdef) {} in GraphFunction()
23 Status GraphFunction::GetFunctionDef(FunctionDef** fdef) { in GetFunctionDef() argument
24 *fdef = &fdef_; in GetFunctionDef()
/external/tensorflow/tensorflow/core/tfrt/eager/
Dtransform_graph_function.cc35 const FunctionDef& fdef, in TransformGraphFunction() argument
54 auto attrs = AttrSlice(&fdef.attr()); in TransformGraphFunction()
56 func_name, attrs, &fdef, func_lib_def, &graph, &arg_nodes, &ret_nodes, in TransformGraphFunction()
58 for (const auto& control_ret : fdef.control_ret()) { in TransformGraphFunction()
76 int output_size = fdef.signature().output_arg_size(); in TransformGraphFunction()
108 for (const auto& control_ret : fdef.control_ret()) { in TransformGraphFunction()
128 optimization_options.function_def = &fdef; in TransformGraphFunction()
161 fdef.signature().name(), grappler_options, &graph); in TransformGraphFunction()
/external/tensorflow/tensorflow/cc/experimental/libtf/tests/
Dfunction_test.cc153 FunctionDef fdef = SquareFunc(); in TEST_P() local
154 AbstractFunctionPtr trace(new GraphFunction(fdef), /*add_ref=*/false); in TEST_P()
171 FunctionDef fdef = AddFunc(); in TEST_P() local
172 AbstractFunctionPtr trace(new GraphFunction(fdef), /*add_ref=*/false); in TEST_P()
194 FunctionDef fdef = IdentityNFunc(); in TEST_P() local
195 AbstractFunctionPtr trace(new GraphFunction(fdef), /*add_ref=*/false); in TEST_P()
217 FunctionDef fdef = SquareFunc(); in TEST_P() local
218 AbstractFunctionPtr trace(new GraphFunction(fdef), /*add_ref=*/false); in TEST_P()
239 FunctionDef fdef = IdentityNFunc(); in TEST_P() local
240 AbstractFunctionPtr trace(new GraphFunction(fdef), /*add_ref=*/false); in TEST_P()
[all …]
/external/tensorflow/tensorflow/core/ir/importexport/
Dfunctiondef_export.cc152 FunctionDef fdef; in ConvertGenericFunctionToFunctionDef() local
160 &op, fdef.add_node_def(), tfg_dialect, in ConvertGenericFunctionToFunctionDef()
165 OpDef *signature = fdef.mutable_signature(); in ConvertGenericFunctionToFunctionDef()
227 (*fdef.mutable_arg_attr())[arg_num / 2] = std::move(func_def_arg_attrs); in ConvertGenericFunctionToFunctionDef()
256 fdef.mutable_control_ret()->insert( in ConvertGenericFunctionToFunctionDef()
270 fdef.mutable_ret()->insert({name.getValue().str(), ret_name}); in ConvertGenericFunctionToFunctionDef()
293 auto *unique_ids_map = fdef.mutable_resource_arg_unique_id(); in ConvertGenericFunctionToFunctionDef()
304 fdef.mutable_attr())); in ConvertGenericFunctionToFunctionDef()
305 return fdef; in ConvertGenericFunctionToFunctionDef()
/external/tensorflow/tensorflow/core/data/
Dcaptured_function.cc232 const FunctionDef* fdef = lib_def->Find(func_name); in CreateFunctionLibraryDefinition() local
233 if (TF_PREDICT_FALSE(fdef == nullptr)) { in CreateFunctionLibraryDefinition()
238 lib_def->ReachableDefinitions(*fdef)); in CreateFunctionLibraryDefinition()
243 const string& name, const FunctionDef** fdef) { in LookupFunction() argument
244 *fdef = lib_def.Find(name); in LookupFunction()
245 if (*fdef == nullptr) { in LookupFunction()
447 const FunctionDef* fdef; in Create() local
449 (*out_metadata)->func().name(), &fdef)); in Create()
451 auto attr = fdef->attr().find(FunctionLibraryDefinition::kIntsOnDeviceAttr); in Create()
452 if (attr != fdef->attr().end() && attr->second.b()) { in Create()
[all …]
/external/tensorflow/tensorflow/lite/delegates/flex/
Ddelegate_data.cc57 tensorflow::FunctionDef& fdef) { in BuildFunctionDefProto() argument
93 fdef = tensorflow::FunctionDefHelper::Create(function_name, inputs, outputs, in BuildFunctionDefProto()
107 fdef.mutable_node_def(1)->mutable_attr()->insert({"Tin", tin_attrs}); in BuildFunctionDefProto()
108 fdef.mutable_node_def(1)->mutable_attr()->insert({"Tout", tout_attrs}); in BuildFunctionDefProto()
185 tensorflow::FunctionDef fdef; in RegisterFunctionDefForSubgraphs() local
186 BuildFunctionDefProto(subgraph_name, *(subgraphs->at(i)), fdef); in RegisterFunctionDefForSubgraphs()
187 TF_RETURN_IF_ERROR(eager_context->AddFunctionDef(fdef)); in RegisterFunctionDefForSubgraphs()

123456