本文整理匯總了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