| 529 | } // namespace |
| 530 | |
| 531 | Status 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 |
no test coverage detected