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

Method Create

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

Source from the content-addressed store, hash-verified

352} // namespace
353
354OpSpec OpSpec::Create(const OpDef& op_def, const ApiDef& api_def) {
355 OpSpec op(api_def.graph_op_name(), api_def.visibility() == ApiDef::HIDDEN,
356 op_def.deprecation().explanation());
357 TypeResolver type_resolver(op_def);
358 for (const string& next_input_name : api_def.arg_order()) {
359 for (int i = 0; i < op_def.input_arg().size(); ++i) {
360 if (op_def.input_arg(i).name() == next_input_name) {
361 op.inputs_.push_back(CreateInput(op_def.input_arg(i), api_def.in_arg(i),
362 &type_resolver));
363 break;
364 }
365 }
366 }
367 for (int i = 0; i < op_def.attr().size(); ++i) {
368 // do not parse attributes already visited, they have probably been inferred
369 // before as an input argument type
370 if (!type_resolver.IsAttributeVisited(op_def.attr(i).name())) {
371 AttributeSpec attr =
372 CreateAttribute(op_def.attr(i), api_def.attr(i), &type_resolver);
373 // attributes with a default value are optional
374 if (attr.has_default_value() && attr.type().kind() != Type::GENERIC) {
375 op.optional_attributes_.push_back(attr);
376 } else {
377 op.attributes_.push_back(attr);
378 }
379 }
380 }
381 for (int i = 0; i < op_def.output_arg().size(); ++i) {
382 op.outputs_.push_back(
383 CreateOutput(op_def.output_arg(i), api_def.out_arg(i), &type_resolver));
384 }
385 for (const auto& endpoint_def : api_def.endpoint()) {
386 op.endpoints_.push_back(CreateEndpoint(op_def, api_def, endpoint_def));
387 }
388 return op;
389}
390
391} // namespace java
392} // namespace tensorflow

Callers

nothing calls this directly

Calls 12

CreateAttributeFunction · 0.85
CreateOutputFunction · 0.85
CreateEndpointFunction · 0.85
attrMethod · 0.80
IsAttributeVisitedMethod · 0.80
has_default_valueMethod · 0.80
CreateInputFunction · 0.70
nameMethod · 0.65
typeMethod · 0.65
sizeMethod · 0.45
push_backMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected