Skip to content

Instantly share code, notes, and snippets.

@yaroslavvb
Created December 11, 2016 01:44
Show Gist options
  • Save yaroslavvb/08227f38f2fc3a92b32a7a0a6927500b to your computer and use it in GitHub Desktop.
Save yaroslavvb/08227f38f2fc3a92b32a7a0a6927500b to your computer and use it in GitHub Desktop.
count number of ops in TensorFlow low-level API
from google.protobuf import text_format
from tensorflow.core.framework import op_def_pb2
ops = op_def_pb2.OpList()
ops_text = open("/local_home/yaroslav/tensorflow.git/tensorflow/tensorflow/core/ops/ops.pbtxt").read()
text_format.Merge(ops_text, ops)
print(len(ops.op))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment