本文整理汇总了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
示例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()
示例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
示例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
示例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