| 144 | } // namespace tensorflow |
| 145 | |
| 146 | int main(int argc, char* argv[]) { |
| 147 | tensorflow::port::InitMain(argv[0], &argc, &argv); |
| 148 | |
| 149 | tensorflow::string source_file_name = |
| 150 | tensorflow::InferSourceFileName(argv[0]); |
| 151 | |
| 152 | // Usage: |
| 153 | // gen_main api_def_dir1,api_def_dir2,... |
| 154 | // [ @FILENAME | OpName[,OpName]* ] (0 | 1) [0 | 1] |
| 155 | if (argc < 3) { |
| 156 | return -1; |
| 157 | } |
| 158 | std::vector<tensorflow::string> api_def_dirs = tensorflow::str_util::Split( |
| 159 | argv[1], ",", tensorflow::str_util::SkipEmpty()); |
| 160 | |
| 161 | if (argc == 3) { |
| 162 | tensorflow::PrintAllPythonOps({}, api_def_dirs, source_file_name, |
| 163 | tensorflow::string(argv[2]) == "1", |
| 164 | false /* op_list_is_whitelist */); |
| 165 | } else if (argc == 4) { |
| 166 | std::vector<tensorflow::string> hidden_ops; |
| 167 | TF_CHECK_OK(tensorflow::ParseOpListCommandLine(argv[2], &hidden_ops)); |
| 168 | tensorflow::PrintAllPythonOps(hidden_ops, api_def_dirs, source_file_name, |
| 169 | tensorflow::string(argv[3]) == "1", |
| 170 | false /* op_list_is_whitelist */); |
| 171 | } else if (argc == 5) { |
| 172 | std::vector<tensorflow::string> op_list; |
| 173 | TF_CHECK_OK(tensorflow::ParseOpListCommandLine(argv[2], &op_list)); |
| 174 | tensorflow::PrintAllPythonOps(op_list, api_def_dirs, source_file_name, |
| 175 | tensorflow::string(argv[3]) == "1", |
| 176 | tensorflow::string(argv[4]) == "1"); |
| 177 | } else { |
| 178 | return -1; |
| 179 | } |
| 180 | return 0; |
| 181 | } |
nothing calls this directly
no test coverage detected