當前位置: 首頁>>代碼示例>>Python>>正文


Python tensorflow.__git_version__方法代碼示例

本文整理匯總了Python中tensorflow.__git_version__方法的典型用法代碼示例。如果您正苦於以下問題:Python tensorflow.__git_version__方法的具體用法?Python tensorflow.__git_version__怎麽用?Python tensorflow.__git_version__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tensorflow的用法示例。


在下文中一共展示了tensorflow.__git_version__方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _ensure_tf2

# 需要導入模塊: import tensorflow [as 別名]
# 或者: from tensorflow import __git_version__ [as 別名]
def _ensure_tf2():
  """Ensure running with TensorFlow 2 behavior.

  This function is safe to call even before flags have been parsed.

  Raises:
    ImportError: If tensorflow is too old for proper TF2 behavior.
  """
  print("Running with tensorflow %s (git version %s)",
        tf.__version__, tf.__git_version__)
  if tf.__version__.startswith("1."):
    if tf.__git_version__ == "unknown":  # For internal testing use.
      try:
        tf.compat.v1.enable_v2_behavior()
        return
      except AttributeError:
        pass  # Fail below for missing enabler function.
    raise ImportError("Sorry, this program needs TensorFlow 2.") 
開發者ID:tensorflow,項目名稱:hub,代碼行數:20,代碼來源:make_nearest_neighbour_index.py

示例2: main

# 需要導入模塊: import tensorflow [as 別名]
# 或者: from tensorflow import __git_version__ [as 別名]
def main(_):
  logging.info('Current tf version: %s', tf.__version__)
  logging.info('Current tf git version: %s', tf.__git_version__)
  run_training() 
開發者ID:GoogleCloudPlatform,項目名稱:cloudml-samples,代碼行數:6,代碼來源:task.py

示例3: testGitAndCompilerVersion

# 需要導入模塊: import tensorflow [as 別名]
# 或者: from tensorflow import __git_version__ [as 別名]
def testGitAndCompilerVersion(self):
    self.assertEqual(type(tf.__git_version__), str)
    self.assertEqual(type(tf.__compiler_version__), str)
    self.assertEqual(type(tf.GIT_VERSION), str)
    self.assertEqual(type(tf.COMPILER_VERSION), str) 
開發者ID:tobegit3hub,項目名稱:deep_image_model,代碼行數:7,代碼來源:versions_test.py

示例4: tensorflow_python_version

# 需要導入模塊: import tensorflow [as 別名]
# 或者: from tensorflow import __git_version__ [as 別名]
def tensorflow_python_version():
    import tensorflow as tf

    logging.info("tensorflow.__version__: %r", tf.__version__)
    logging.info("tensorflow.__git_version__: %r", tf.__git_version__) 
開發者ID:tensorflow,項目名稱:tensorboard,代碼行數:7,代碼來源:diagnose_tensorboard.py


注:本文中的tensorflow.__git_version__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。