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

Method Run

tensorflow/java/src/gen/cc/op_generator.cc:531–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529} // namespace
530
531Status OpGenerator::Run(const OpList& op_list, const string& base_package,
532 const string& output_dir) {
533 ApiDefMap api_map(op_list);
534 if (!api_dirs_.empty()) {
535 // Only load api files that correspond to the requested "op_list"
536 for (const auto& op : op_list.op()) {
537 for (const auto& api_def_dir : api_dirs_) {
538 const std::string api_def_file_pattern =
539 io::JoinPath(api_def_dir, "api_def_" + op.name() + ".pbtxt");
540 if (env_->FileExists(api_def_file_pattern).ok()) {
541 TF_CHECK_OK(api_map.LoadFile(env_, api_def_file_pattern))
542 << api_def_file_pattern;
543 }
544 }
545 }
546 }
547 api_map.UpdateDocs();
548 for (const auto& op_def : op_list.op()) {
549 const ApiDef* api_def = api_map.GetApiDef(op_def.name());
550 if (CanGenerateOp(op_def, *api_def)) {
551 OpSpec op(OpSpec::Create(op_def, *api_def));
552 for (const EndpointSpec& endpoint : op.endpoints()) {
553 GenerateOp(op, endpoint, base_package, output_dir, env_);
554 }
555 }
556 }
557 return Status::OK();
558}
559
560} // namespace java
561} // namespace tensorflow

Callers 1

mainFunction · 0.45

Calls 13

CanGenerateOpFunction · 0.85
GenerateOpFunction · 0.85
LoadFileMethod · 0.80
UpdateDocsMethod · 0.80
GetApiDefMethod · 0.80
endpointsMethod · 0.80
nameMethod · 0.65
JoinPathFunction · 0.50
CreateFunction · 0.50
emptyMethod · 0.45
opMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected