Home
last modified time | relevance | path

Searched refs:attr_def (Results 1 – 18 of 18) sorted by relevance

/external/tensorflow/tensorflow/python/framework/
Dop_def_library.py55 def _SatisfiesTypeConstraint(dtype, attr_def, param_name): argument
56 if attr_def.HasField("allowed_values"):
57 allowed_list = attr_def.allowed_values.list.type
66 def _SatisfiesLengthConstraint(length, attr_def, param_name, op_type_name): argument
67 if attr_def.has_minimum and length < attr_def.minimum:
70 (param_name, op_type_name, length, attr_def.minimum))
73 def _SatisfiesAllowedStringsConstraint(value, attr_def, arg_name, op_type_name): argument
74 if value not in attr_def.allowed_values.list.s:
78 map(compat.as_text, attr_def.allowed_values.list.s))))
81 def _SatisfiesIntMinimumConstraint(value, attr_def, arg_name, op_type_name): argument
[all …]
Dpython_api_info.cc142 for (const auto& attr_def : op_def.attr()) { in Initialize() local
143 TF_RETURN_IF_ERROR(InitializeAttribute(attr_def, param_name_to_index)); in Initialize()
230 const OpDef::AttrDef& attr_def, in InitializeAttribute() argument
232 if (attr_def.name() == "name") { in InitializeAttribute()
236 const char* name = InternPyString(attr_def.name()); in InitializeAttribute()
239 gtl::FindWithDefault(param_name_to_index, attr_def.name(), -1); in InitializeAttribute()
240 const AttributeType dtype = AttributeTypeFromName(attr_def.type()); in InitializeAttribute()
246 attr_def.name(), ": '", attr_def.type(), in InitializeAttribute()
252 DataType default_dtype = attr_def.has_default_value() in InitializeAttribute()
253 ? attr_def.default_value().type() in InitializeAttribute()
[all …]
Dimporter.py139 for attr_def in op_def.attr:
140 if attr_name == attr_def.name:
141 return attr_def
170 attr_def = _FindAttrInOpDef(key, producer_op_def)
171 if (attr_def and attr_def.HasField('default_value') and
172 node.attr[key] == attr_def.default_value):
339 for attr_def in op_def.attr:
340 key = attr_def.name
341 if attr_def.HasField('default_value'):
344 node_def.attr[key].CopyFrom(attr_def.default_value)
Dmeta_graph.py450 for attr_def in op_def.attr:
451 if attr_def.name == attr_name:
452 if not attr_def.HasField("default_value"):
458 attr_def.default_value.SerializeToString())
Dpython_api_info.h230 const OpDef::AttrDef& attr_def,
/external/tensorflow/tensorflow/java/src/gen/cc/
Dop_specs.cc64 std::pair<Type, Type> TypesOf(const OpDef_AttrDef& attr_def,
103 for (const auto& attr_def : op_def_.attr()) { in TypeOf() local
104 if (attr_def.name() == arg_def.type_attr()) { in TypeOf()
105 type = TypesOf(attr_def, iterable_out).first; in TypeOf()
128 std::pair<Type, Type> TypeResolver::TypesOf(const OpDef_AttrDef& attr_def, in TypesOf() argument
132 StringPiece attr_type = attr_def.type(); in TypesOf()
158 if (IsRealNumbers(attr_def.allowed_values())) { in TypesOf()
167 visited_attrs_.insert(std::make_pair(attr_def.name(), types.first)); in TypesOf()
301 AttributeSpec CreateAttribute(const OpDef_AttrDef& attr_def, in CreateAttribute() argument
305 std::pair<Type, Type> types = type_resolver->TypesOf(attr_def, &iterable); in CreateAttribute()
[all …]
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/translate/
Dupgrade_graph.cc54 [](const auto& attr_def) { in GenerateResourceSharedNameIfEmpty() argument
55 return attr_def.name() == "use_node_name_sharing" && in GenerateResourceSharedNameIfEmpty()
56 attr_def.type() == "bool"; in GenerateResourceSharedNameIfEmpty()
62 [](const auto& attr_def) { in GenerateResourceSharedNameIfEmpty() argument
63 return attr_def.name() == "shared_name" && in GenerateResourceSharedNameIfEmpty()
64 attr_def.type() == "string"; in GenerateResourceSharedNameIfEmpty()
Dexport_tf_dialect_op.cc105 for (const auto& attr_def : op_reg_data->op_def.attr()) { in GetUnregisteredAttrs() local
106 registered_attrs.insert(attr_def.name()); in GetUnregisteredAttrs()
/external/tensorflow/tensorflow/core/common_runtime/eager/
Dattr_builder.cc181 for (const auto& attr_def : op_def->attr()) { in FillAttrValueMap() local
182 if (attr_def.has_default_value() && !m->count(attr_def.name())) { in FillAttrValueMap()
183 SetInAttrValueMap(m, attr_def.name(), attr_def.default_value()); in FillAttrValueMap()
194 for (const OpDef::AttrDef& attr_def : op_def->attr()) { in ValueMatchesDefault() local
195 if (attr_def.name() == attr_name && attr_def.has_default_value() && in ValueMatchesDefault()
196 AreAttrValuesEqual(attr_def.default_value(), attr_value)) { in ValueMatchesDefault()
/external/tensorflow/tensorflow/compiler/mlir/tfr/python/
Dtfr_gen.py104 def _get_type_from_proto(arg_def=None, attr_def=None): argument
106 if attr_def.type == 'bool':
108 elif attr_def.type == 'int32':
110 elif attr_def.type == 'int' or attr_def.type == 'int64':
112 elif attr_def.type == 'float':
123 def _get_type_info_from_proto(arg_def=None, attr_def=None): argument
124 attr_type = _get_type_from_proto(arg_def, attr_def)
127 attr_type, attr_def.name, attr_def.type)
298 for attr_def in attrs_no_default + attrs_with_default:
299 inputs.append(_get_type_info_from_proto(None, attr_def))
[all …]
/external/tensorflow/tensorflow/core/framework/
Dgraph_def_util.cc184 for (const OpDef::AttrDef& attr_def : op_def->attr()) { in StripDefaultAttributes() local
185 if (attr_def.has_default_value()) { in StripDefaultAttributes()
187 const string& name = attr_def.name(); in StripDefaultAttributes()
190 const AttrValue& default_value = attr_def.default_value(); in StripDefaultAttributes()
Dop_def_util_test.cc37 OpDef::AttrDef attr_def; in ADef() local
38 EXPECT_TRUE(protobuf::TextFormat::MergeFromString(text, &attr_def)); in ADef()
39 return attr_def; in ADef()
Dfunction.cc696 for (const auto& attr_def : op_def->attr()) { in AddDefaultAttrs() local
697 if (attr_def.has_default_value() && !attr_slice.Find(attr_def.name())) { in AddDefaultAttrs()
698 if (!attrs->insert({attr_def.name(), attr_def.default_value()}).second) { in AddDefaultAttrs()
699 return errors::Internal("Somehow duplicated: ", attr_def.name()); in AddDefaultAttrs()
1813 gtl::ArraySlice<string> out_def, gtl::ArraySlice<string> attr_def, in Create() argument
1823 for (const auto& a : attr_def) b.Attr(a); in Create()
1863 gtl::ArraySlice<string> out_def, gtl::ArraySlice<string> attr_def, in Create() argument
1866 return Create(function_name, in_def, out_def, attr_def, node_def, ret_def, in Create()
1874 gtl::ArraySlice<string> attr_def, in Define() argument
1880 for (const auto& a : attr_def) b.Attr(a); in Define()
[all …]
Dfunction.h147 gtl::ArraySlice<string> out_def, gtl::ArraySlice<string> attr_def,
159 gtl::ArraySlice<string> attr_def,
167 gtl::ArraySlice<string> attr_def,
173 gtl::ArraySlice<string> attr_def,
Dnode_def_util.cc724 for (const auto& attr_def : op_def.attr()) { in AddDefaultsToNodeDef() local
726 if (attr_def.has_default_value() && !attrs.Find(attr_def.name())) { in AddDefaultsToNodeDef()
727 AddNodeAttr(attr_def.name(), attr_def.default_value(), node_def); in AddDefaultsToNodeDef()
Dgraph_to_functiondef.cc285 OpDef::AttrDef* attr_def = fdef->mutable_signature()->add_attr(); in FillFunctionBody() local
286 attr_def->set_name(func_attr_name); in FillFunctionBody()
287 attr_def->set_type(node_attr_def->type()); in FillFunctionBody()
/external/tensorflow/tensorflow/compiler/tf2xla/
Dxla_op_registry.cc233 for (const OpDef::AttrDef& attr_def : op_def->attr()) { in RegisterCompilationKernels() local
234 if (attr_def.type() == "type" || attr_def.type() == "list(type)") { in RegisterCompilationKernels()
235 type_attrs.insert(attr_def.name()); in RegisterCompilationKernels()
/external/tensorflow/tensorflow/core/grappler/optimizers/
Dauto_mixed_precision.cc333 const OpDef::AttrDef* attr_def = FindAttr(attr_name, op_def); in AddNode() local
334 if (!attr_def) { in AddNode()
338 if (attr_def->type() == "type") { in AddNode()
340 } else if (attr_def->type() == "list(type)") { in AddNode()
824 DataTypeSet AllowedDataTypes(const OpDef::AttrDef& attr_def) { in AllowedDataTypes() argument
825 const auto& allowed_types = attr_def.allowed_values().list().type(); in AllowedDataTypes()
840 const OpDef::AttrDef* attr_def = FindAttr(t_attr_id.attr_name, op_def); in AllowedDataTypes() local
841 CHECK(attr_def); // Crash Ok in AllowedDataTypes()
842 return AllowedDataTypes(*attr_def); in AllowedDataTypes()