Home
last modified time | relevance | path

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

12

/external/tensorflow/tensorflow/python/framework/
Dop_def_library.py51 def _SatisfiesTypeConstraint(dtype, attr_def, param_name): argument
52 if attr_def.HasField("allowed_values"):
53 allowed_list = attr_def.allowed_values.list.type
62 def _SatisfiesLengthConstraint(length, attr_def, param_name, op_type_name): argument
63 if attr_def.has_minimum and length < attr_def.minimum:
69 def _SatisfiesAllowedStringsConstraint(value, attr_def, arg_name, op_type_name): argument
70 if value not in attr_def.allowed_values.list.s:
72 map(compat.as_text, attr_def.allowed_values.list.s))
77 def _SatisfiesIntMinimumConstraint(value, attr_def, arg_name, op_type_name): argument
78 if value < attr_def.minimum:
[all …]
Dop_def_library_pybind.cc266 const AttrDef& attr_def, in AssertSatisfiesLengthConstraint() argument
269 if (!absl::StartsWith(attr_def.type(), kListPrefix)) return; in AssertSatisfiesLengthConstraint()
271 if (attr_def.has_minimum() && attr_size < attr_def.minimum()) { in AssertSatisfiesLengthConstraint()
274 " less than minimum ", attr_def.minimum(), in AssertSatisfiesLengthConstraint()
293 const AttrDef& attr_def, in AssertSatisfiesAllowedStringsConstraint() argument
297 if (!attr_def.has_allowed_values()) return; in AssertSatisfiesAllowedStringsConstraint()
298 const auto& allowed_values = attr_def.allowed_values().list().s(); in AssertSatisfiesAllowedStringsConstraint()
311 const AttrDef& attr_def, in AssertSatisfiesIntMinimumConstraint() argument
315 if (attr_def.has_minimum() && attr_type == AttributeType::INT && in AssertSatisfiesIntMinimumConstraint()
316 attr.i() < attr_def.minimum()) { in AssertSatisfiesIntMinimumConstraint()
[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.py143 for attr_def in op_def.attr:
144 if attr_name == attr_def.name:
145 return attr_def
174 attr_def = _FindAttrInOpDef(key, producer_op_def)
175 if (attr_def and attr_def.HasField('default_value') and
176 node.attr[key] == attr_def.default_value):
342 for attr_def in op_def.attr:
343 key = attr_def.name
344 if attr_def.HasField('default_value'):
347 node_def.attr[key].CopyFrom(attr_def.default_value)
Dmeta_graph.py449 for attr_def in op_def.attr:
450 if attr_def.name == attr_name:
451 if not attr_def.HasField("default_value"):
457 attr_def.default_value.SerializeToString())
/external/tensorflow/tensorflow/c/experimental/ops/gen/model/
Dattr_spec.cc22 AttrSpec AttrSpec::Create(const OpDef::AttrDef& attr_def) { in Create() argument
23 return AttrSpec(attr_def); in Create()
26 AttrSpec::AttrSpec(const OpDef::AttrDef& attr_def) { in AttrSpec() argument
27 name_ = attr_def.name(); in AttrSpec()
28 description_ = attr_def.description(); in AttrSpec()
29 full_type_ = attr_def.type(); in AttrSpec()
30 default_value_ = attr_def.default_value(); in AttrSpec()
Dop_spec.cc51 for (const OpDef::AttrDef& attr_def : op_def.attr()) { in OpSpec() local
52 AttrSpec attr = AttrSpec::Create(attr_def); in OpSpec()
54 if (inferred_attrs.find(attr_def.name()) == inferred_attrs.end()) { in OpSpec()
Dattr_spec.h32 static AttrSpec Create(const OpDef::AttrDef& attr_def);
42 explicit AttrSpec(const OpDef::AttrDef& attr_def);
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/translate/
Dupgrade_graph.cc59 [](const auto& attr_def) { in GenerateResourceSharedNameIfEmpty() argument
60 return attr_def.name() == "use_node_name_sharing" && in GenerateResourceSharedNameIfEmpty()
61 attr_def.type() == "bool"; in GenerateResourceSharedNameIfEmpty()
67 [](const auto& attr_def) { in GenerateResourceSharedNameIfEmpty() argument
68 return attr_def.name() == "shared_name" && in GenerateResourceSharedNameIfEmpty()
69 attr_def.type() == "string"; in GenerateResourceSharedNameIfEmpty()
Dexport_tf_dialect_op.cc104 for (const auto& attr_def : op_reg_data->op_def.attr()) { in GetUnregisteredAttrs() local
105 registered_attrs.insert(attr_def.name()); in GetUnregisteredAttrs()
/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/core/common_runtime/eager/
Dattr_builder.cc198 for (const auto& attr_def : op_def->attr()) { in FillAttrValueMap() local
199 if (attr_def.has_default_value() && !m->count(attr_def.name())) { in FillAttrValueMap()
200 SetInAttrValueMap(m, attr_def.name(), attr_def.default_value()); in FillAttrValueMap()
211 for (const OpDef::AttrDef& attr_def : op_def->attr()) { in ValueMatchesDefault() local
212 if (attr_def.name() == attr_name && attr_def.has_default_value() && in ValueMatchesDefault()
213 AreAttrValuesEqual(attr_def.default_value(), attr_value)) { in ValueMatchesDefault()
/external/tensorflow/tensorflow/compiler/mlir/tfr/python/
Dtfr_gen.py112 def _get_type_from_proto(arg_def=None, attr_def=None): argument
114 if attr_def.type == 'bool':
116 elif attr_def.type == 'int32':
118 elif attr_def.type == 'int' or attr_def.type == 'int64':
120 elif attr_def.type == 'float':
131 def _get_type_info_from_proto(arg_def=None, attr_def=None): argument
132 attr_type = _get_type_from_proto(arg_def, attr_def)
135 attr_type, attr_def.name, attr_def.type)
306 for attr_def in attrs_no_default + attrs_with_default:
307 inputs.append(_get_type_info_from_proto(None, attr_def))
[all …]
/external/tensorflow/tensorflow/core/tfrt/fallback/
Dop_kernel_runner.cc58 for (const auto& attr_def : op_def.attr()) { in BuildNodeDef() local
59 if (attr_def.has_default_value()) { in BuildNodeDef()
61 attr_value_map->insert({attr_def.name(), attr_def.default_value()}); in BuildNodeDef()
/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()
Dnode_def_util.cc772 for (const auto& attr_def : op_def.attr()) { in AddDefaultsToNodeDef() local
774 if (attr_def.has_default_value() && !attrs.Find(attr_def.name())) { in AddDefaultsToNodeDef()
775 AddNodeAttr(attr_def.name(), attr_def.default_value(), node_def); in AddDefaultsToNodeDef()
782 for (const auto& attr_def : op_def.attr()) { in StripDefaultsFromNodeDef() local
783 if (attr_def.has_default_value()) { in StripDefaultsFromNodeDef()
784 const AttrValue* attr = attrs.Find(attr_def.name()); in StripDefaultsFromNodeDef()
785 if (attr && AreAttrValuesEqual(*attr, attr_def.default_value())) in StripDefaultsFromNodeDef()
786 node_def->mutable_attr()->erase(attr_def.name()); in StripDefaultsFromNodeDef()
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.cc725 for (const auto& attr_def : op_def->attr()) { in AddDefaultAttrs() local
726 if (attr_def.has_default_value() && !attr_slice.Find(attr_def.name())) { in AddDefaultAttrs()
727 if (!attrs->insert({attr_def.name(), attr_def.default_value()}).second) { in AddDefaultAttrs()
728 return errors::Internal("Somehow duplicated: ", attr_def.name()); in AddDefaultAttrs()
1883 gtl::ArraySlice<string> out_def, gtl::ArraySlice<string> attr_def, in Create() argument
1893 for (const auto& a : attr_def) b.Attr(a); in Create()
1933 gtl::ArraySlice<string> out_def, gtl::ArraySlice<string> attr_def, in Create() argument
1936 return Create(function_name, in_def, out_def, attr_def, node_def, ret_def, in Create()
1944 gtl::ArraySlice<string> attr_def, in Define() argument
1950 for (const auto& a : attr_def) b.Attr(a); in Define()
[all …]
Dfunction.h165 gtl::ArraySlice<string> out_def, gtl::ArraySlice<string> attr_def,
177 gtl::ArraySlice<string> attr_def,
185 gtl::ArraySlice<string> attr_def,
191 gtl::ArraySlice<string> attr_def,
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/core/runtime_fallback/kernel/
Dop_kernel_runner.cc60 for (const auto& attr_def : op_def.attr()) { in BuildNodeDef() local
61 if (attr_def.has_default_value()) { in BuildNodeDef()
63 attr_value_map->insert({attr_def.name(), attr_def.default_value()}); in BuildNodeDef()
/external/tensorflow/tensorflow/core/ir/importexport/
Dfunctiondef_import.cc288 NamedAttrList attr_def; in ImportGenericFunction() local
292 attr_def.append(builder.getNamedAttr( in ImportGenericFunction()
297 attr_def.append(builder.getNamedAttr("default_value", attr)); in ImportGenericFunction()
300 attr_def.append(builder.getNamedAttr( in ImportGenericFunction()
303 attr_def.append(builder.getNamedAttr( in ImportGenericFunction()
309 attr_def.append(builder.getNamedAttr("allowed_values", attr)); in ImportGenericFunction()
312 attr.name(), attr_def.getDictionary(builder.getContext()))); in ImportGenericFunction()
Dgraphdef_import.cc801 for (const auto &attr_def : op_def->attr()) { in ConvertNodeDef() local
802 if (attr_def.has_default_value() && in ConvertNodeDef()
803 !state.attributes.get(attr_def.name())) { in ConvertNodeDef()
805 ConvertAttributeValue(attr_def.default_value(), b_)); in ConvertNodeDef()
806 state.addAttribute(attr_def.name(), attr); in ConvertNodeDef()
/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.cc399 const OpDef::AttrDef* attr_def = FindAttr(attr_name, op_def); in AddNode() local
400 if (!attr_def) { in AddNode()
404 if (attr_def->type() == "type") { in AddNode()
406 } else if (attr_def->type() == "list(type)") { in AddNode()
890 DataTypeSet AllowedDataTypes(const OpDef::AttrDef& attr_def) { in AllowedDataTypes() argument
891 const auto& allowed_types = attr_def.allowed_values().list().type(); in AllowedDataTypes()
906 const OpDef::AttrDef* attr_def = FindAttr(t_attr_id.attr_name, op_def); in AllowedDataTypes() local
907 CHECK(attr_def); // Crash Ok in AllowedDataTypes()
908 return AllowedDataTypes(*attr_def); in AllowedDataTypes()

12