aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/framework/python_op_gen_main.cc
blob: 29afe355982222802e255fc5d0c5a785494bb4f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "tensorflow/python/framework/python_op_gen.h"

#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_def.pb.h"
#include "tensorflow/core/platform/init_main.h"
#include "tensorflow/core/platform/logging.h"

namespace tensorflow {
namespace {

void PrintAllPythonOps(const char* hidden, bool require_shapes) {
  OpList ops;
  OpRegistry::Global()->Export(false, &ops);
  PrintPythonOps(ops, hidden, require_shapes);
}

}  // namespace
}  // namespace tensorflow

int main(int argc, char* argv[]) {
  tensorflow::port::InitMain(argv[0], &argc, &argv);
  if (argc == 2) {
    tensorflow::PrintAllPythonOps("", std::string(argv[1]) == "1");
  } else if (argc == 3) {
    tensorflow::PrintAllPythonOps(argv[1], std::string(argv[2]) == "1");
  } else {
    return -1;
  }
  return 0;
}