| 28 | namespace { |
| 29 | |
| 30 | void PrintAllCCOps(const std::string& dot_h, const std::string& dot_cc, |
| 31 | bool include_internal, |
| 32 | const std::vector<string>& api_def_dirs) { |
| 33 | OpList ops; |
| 34 | OpRegistry::Global()->Export(include_internal, &ops); |
| 35 | ApiDefMap api_def_map(ops); |
| 36 | if (!api_def_dirs.empty()) { |
| 37 | Env* env = Env::Default(); |
| 38 | // Only load files that correspond to "ops". |
| 39 | for (const auto& op : ops.op()) { |
| 40 | for (const auto& api_def_dir : api_def_dirs) { |
| 41 | const std::string api_def_file_pattern = |
| 42 | io::JoinPath(api_def_dir, "api_def_" + op.name() + ".pbtxt"); |
| 43 | if (env->FileExists(api_def_file_pattern).ok()) { |
| 44 | TF_CHECK_OK(api_def_map.LoadFile(env, api_def_file_pattern)); |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | api_def_map.UpdateDocs(); |
| 51 | |
| 52 | WriteCCOps(ops, api_def_map, dot_h, dot_cc); |
| 53 | } |
| 54 | |
| 55 | } // namespace |
| 56 | } // namespace tensorflow |
no test coverage detected