message: Add raw_ops_doc based on the version of tf
diff: @@ -28,9 +28,12 @@ from __future__ import division
  from __future__ import print_function
  from os import path
  +import textwrap
  from absl import app
  from absl import flags
  +from distutils.version import LooseVersion
  +
  import tensorflow as tf
  from tensorflow_docs.api_generator import doc_controls
  @@ -139,13 +142,17 @@ else:
  ```
  """
  -tf.raw_ops.__doc__ += """
  -
  +_raw_ops_doc = textwrap.dedent("""\n
  Note: `tf.raw_ops` provides direct/low level access to all TensorFlow ops. See \
  [the RFC](https://github.com/tensorflow/community/blob/master/rfcs/20181225-tf-raw-ops.md)
  for details. Unless you are library writer, you likely do not need to use these
  -ops directly.
  -"""
  + ops directly.""")
  +
  +if LooseVersion(tf.__version__) < LooseVersion('2'):
  + tf.raw_ops.__doc__ = _raw_ops_doc
  +else:
  + tf.raw_ops.__doc__ += _raw_ops_doc
  +
  # The doc generator isn't aware of tf_export.
  # So prefix the score tuples with -1 when this is the canonical name, +1
  @@ -186,6 +193,7 @@ def _hide_layer_and_module_methods():
  except AttributeError:
  pass
  +
  def build_docs(output_dir, code_url_prefix, search_hints=True):
  """Build api docs for tensorflow v2.
  