title: Getting Protobuf Message for every TensorFlow Operation
body: <p>From <a href="https://www.tensorflow.org/versions/master/how_tos/language_bindings/" rel="nofollow noreferrer">here</a>,</p>
  
  <p>There are a few ways to get a list of the OpDefs for the registered ops:</p>
  
  <blockquote>
    <ul>
    <li>TF_GetAllOpList in the C API retrieves all registered OpDef protocol    messages. This can be used to write the generator in the
    client    language. This requires that the client language have
    protocol buffer    support in order to interpret the OpDef messages. </li>
    <li>The C++ function    OpRegistry::Global()->GetRegisteredOps() returns the same list of all    registered OpDefs (defined in
    [tensorflow/core/framework/op.h]). This    can be used to write the
    generator in C++ (particularly useful for    languages that do not
    have protocol buffer support). </li>
    <li>The    ASCII-serialized version of that list is periodically checked in to    [tensorflow/core/ops/ops.pbtxt] by an automated
    process.</li>
    </ul>
  </blockquote>
  
  <p>But alas, I want to do this in Python like,</p>
  
  <pre><code>import tensorflow as tf
  from google.protobuf import json_format
  json_string = json_format.MessageToJson(tf.GetAllOpsList())
  </code></pre>
  
  <p>I want a way to get the Protobuf message for every operation in Tensorflow so that I can dump it as JSON via </p>