| 33 | #include "tensorflow/core/util/command_line_flags.h" |
| 34 | |
| 35 | int main(int argc, char** argv) { |
| 36 | tensorflow::string api_files_dir; |
| 37 | tensorflow::string op_file_pattern; |
| 38 | std::vector<tensorflow::Flag> flag_list = { |
| 39 | tensorflow::Flag("api_def_dir", &api_files_dir, |
| 40 | "Base directory of api_def*.pbtxt files."), |
| 41 | tensorflow::Flag("op_file_pattern", &op_file_pattern, |
| 42 | "Pattern that matches C++ files containing REGISTER_OP " |
| 43 | "calls. If specified, we will try to remove .Doc() " |
| 44 | "calls for new ops defined in these files.")}; |
| 45 | std::string usage = tensorflow::Flags::Usage(argv[0], flag_list); |
| 46 | bool parsed_values_ok = tensorflow::Flags::Parse(&argc, argv, flag_list); |
| 47 | if (!parsed_values_ok) { |
| 48 | std::cerr << usage << std::endl; |
| 49 | return 2; |
| 50 | } |
| 51 | tensorflow::port::InitMain(argv[0], &argc, &argv); |
| 52 | |
| 53 | tensorflow::OpList ops; |
| 54 | tensorflow::OpRegistry::Global()->Export(false, &ops); |
| 55 | tensorflow::CreateApiDefs(ops, api_files_dir, op_file_pattern); |
| 56 | } |