当前位置: 首页>>代码示例>>Python>>正文


Python googletest.GetTempDir方法代码示例

本文整理汇总了Python中tensorflow.python.platform.googletest.GetTempDir方法的典型用法代码示例。如果您正苦于以下问题:Python googletest.GetTempDir方法的具体用法?Python googletest.GetTempDir怎么用?Python googletest.GetTempDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tensorflow.python.platform.googletest的用法示例。


在下文中一共展示了googletest.GetTempDir方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_temp_dir

# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import GetTempDir [as 别名]
def get_temp_dir(self):
    """Returns a unique temporary directory for the test to use.

    If you call this method multiple times during in a test, it will return the
    same folder. However, across different runs the directories will be
    different. This will ensure that across different runs tests will not be
    able to pollute each others environment.
    If you need multiple unique directories within a single test, you should
    use tempfile.mkdtemp as follows:
      tempfile.mkdtemp(dir=self.get_temp_dir()):

    Returns:
      string, the path to the unique temporary directory created for this test.
    """
    if not self._tempdir:
      self._tempdir = tempfile.mkdtemp(dir=googletest.GetTempDir())
    return self._tempdir 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:19,代码来源:test_util.py

示例2: get_temp_dir

# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import GetTempDir [as 别名]
def get_temp_dir():
  """Returns a temporary directory for use during tests.

  There is no need to delete the directory after the test.

  Returns:
    The temporary directory.
  """
  return _googletest.GetTempDir() 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:11,代码来源:test.py

示例3: get_temp_dir

# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import GetTempDir [as 别名]
def get_temp_dir(self):
    """Returns a unique temporary directory for the test to use.

    Across different test runs, this method will return a different folder.
    This will ensure that across different runs tests will not be able to
    pollute each others environment.

    Returns:
      string, the path to the unique temporary directory created for this test.
    """
    if not self._tempdir:
      self._tempdir = tempfile.mkdtemp(dir=googletest.GetTempDir())
    return self._tempdir 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:15,代码来源:test_util.py

示例4: get_temp_dir

# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import GetTempDir [as 别名]
def get_temp_dir(self):
    if not self._tempdir:
      self._tempdir = googletest.GetTempDir()
    return self._tempdir 
开发者ID:tobegit3hub,项目名称:deep_image_model,代码行数:6,代码来源:test_util.py

示例5: get_temp_dir

# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import GetTempDir [as 别名]
def get_temp_dir(self):
    if not self._tempdir:
      self._tempdir = mkdtemp(dir=googletest.GetTempDir())
    return self._tempdir 
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:6,代码来源:ctl_imagenet_test.py

示例6: get_temp_dir

# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import GetTempDir [as 别名]
def get_temp_dir(self):
    if not self._tempdir:
      self._tempdir = tempfile.mkdtemp(dir=googletest.GetTempDir())
    return self._tempdir 
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:6,代码来源:resnet_cifar_test.py


注:本文中的tensorflow.python.platform.googletest.GetTempDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。