MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateAttribute

Function CreateAttribute

tensorflow/java/src/gen/cc/op_specs.cc:301–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301AttributeSpec CreateAttribute(const OpDef_AttrDef& attr_def,
302 const ApiDef::Attr& attr_api_def,
303 TypeResolver* type_resolver) {
304 bool iterable = false;
305 std::pair<Type, Type> types = type_resolver->TypesOf(attr_def, &iterable);
306 Type var_type = types.first.kind() == Type::GENERIC
307 ? Type::ClassOf(types.first)
308 : types.first;
309 if (iterable) {
310 var_type = Type::ListOf(var_type);
311 }
312 return AttributeSpec(
313 attr_api_def.name(),
314 Variable::Create(SnakeToCamelCase(attr_api_def.rename_to()), var_type),
315 types.first, types.second, ParseDocumentation(attr_api_def.description()),
316 iterable,
317 attr_def.has_default_value() ? &attr_def.default_value() : nullptr);
318}
319
320ArgumentSpec CreateOutput(const OpDef_ArgDef& output_def,
321 const ApiDef::Arg& output_api,

Callers 1

CreateMethod · 0.85

Calls 11

ClassOfFunction · 0.85
AttributeSpecClass · 0.85
SnakeToCamelCaseFunction · 0.85
ParseDocumentationFunction · 0.85
TypesOfMethod · 0.80
descriptionMethod · 0.80
has_default_valueMethod · 0.80
nameMethod · 0.65
CreateFunction · 0.50
kindMethod · 0.45
default_valueMethod · 0.45

Tested by

no test coverage detected