本文整理汇总了Python中tensorflow.python.platform.googletest.main方法的典型用法代码示例。如果您正苦于以下问题:Python googletest.main方法的具体用法?Python googletest.main怎么用?Python googletest.main使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tensorflow.python.platform.googletest
的用法示例。
在下文中一共展示了googletest.main方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testMouseClickOffLinkDoesNotTriggersCommand
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def testMouseClickOffLinkDoesNotTriggersCommand(self):
ui = MockCursesUI(
40,
80,
command_sequence=[
string_to_codes("babble -n 10 -k\n"),
# A click off a hyperlink (too much to the right).
[curses.KEY_MOUSE, 8, 4],
self._EXIT
])
ui.register_command_handler("babble", self._babble, "")
ui.run_ui()
# The mouse click event should not triggered no command.
self.assertEqual(1, len(ui.unwrapped_outputs))
self.assertEqual(["bar"] * 10, ui.unwrapped_outputs[0].lines)
# This command should have generated no main menus.
self.assertEqual([None], ui.main_menu_list)
示例2: test_end_to_end_2_gpu
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_2_gpu(self):
"""Test Keras model with 2 GPUs."""
num_gpus = '2'
if context.num_gpus() < 2:
num_gpus = '0'
extra_flags = [
'-num_gpus', num_gpus,
'-distribution_strategy', 'default',
'-model_dir', 'ctl_imagenet_2_gpu',
'-data_format', 'channels_last',
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=ctl_imagenet_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:21,代码来源:ctl_imagenet_test.py
示例3: test_end_to_end_no_dist_strat
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_no_dist_strat(self):
"""Test Keras model with 1 GPU, no distribution strategy."""
config = keras_utils.get_config_proto_v1()
tf.compat.v1.enable_eager_execution(config=config)
extra_flags = [
"-distribution_strategy", "off",
"-model_dir", "keras_cifar_no_dist_strat",
"-data_format", "channels_last",
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=resnet_cifar_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:19,代码来源:resnet_cifar_test.py
示例4: test_end_to_end_1_gpu
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_1_gpu(self):
"""Test Keras model with 1 GPU."""
config = keras_utils.get_config_proto_v1()
tf.compat.v1.enable_eager_execution(config=config)
if context.num_gpus() < 1:
self.skipTest(
"{} GPUs are not available for this test. {} GPUs are available".
format(1, context.num_gpus()))
extra_flags = [
"-num_gpus", "1",
"-distribution_strategy", "default",
"-model_dir", "keras_cifar_1_gpu",
"-data_format", "channels_last",
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=resnet_cifar_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:25,代码来源:resnet_cifar_test.py
示例5: test_end_to_end_2_gpu
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_2_gpu(self):
"""Test Keras model with 2 GPUs."""
config = keras_utils.get_config_proto_v1()
tf.compat.v1.enable_eager_execution(config=config)
if context.num_gpus() < 2:
self.skipTest(
"{} GPUs are not available for this test. {} GPUs are available".
format(2, context.num_gpus()))
extra_flags = [
"-num_gpus", "2",
"-distribution_strategy", "default",
"-model_dir", "keras_cifar_2_gpu",
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=resnet_cifar_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:24,代码来源:resnet_cifar_test.py
示例6: test_end_to_end_graph_2_gpu
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_graph_2_gpu(self):
"""Test Keras model in legacy graph mode with 2 GPUs."""
if context.num_gpus() < 2:
self.skipTest(
"{} GPUs are not available for this test. {} GPUs are available".
format(2, context.num_gpus()))
extra_flags = [
"-num_gpus", "2",
"-enable_eager", "false",
"-distribution_strategy", "default",
"-model_dir", "keras_cifar_graph_2_gpu",
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=resnet_cifar_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:22,代码来源:resnet_cifar_test.py
示例7: test_end_to_end_1_gpu
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_1_gpu(self):
"""Test Keras model with 1 GPU."""
if context.num_gpus() < 1:
self.skipTest(
"{} GPUs are not available for this test. {} GPUs are available".
format(1, context.num_gpus()))
extra_flags = [
"-num_gpus", "1",
"-distribution_strategy", "mirrored",
"-model_dir", "keras_cifar_1_gpu",
"-data_format", "channels_last",
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=resnet_cifar_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
示例8: test_end_to_end_graph_1_gpu
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_graph_1_gpu(self):
"""Test Keras model in legacy graph mode with 1 GPU."""
if context.num_gpus() < 1:
self.skipTest(
"{} GPUs are not available for this test. {} GPUs are available".
format(1, context.num_gpus()))
extra_flags = [
"-num_gpus", "1",
"-noenable_eager",
"-distribution_strategy", "mirrored",
"-model_dir", "keras_cifar_graph_1_gpu",
"-data_format", "channels_last",
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=resnet_cifar_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
示例9: test_end_to_end_2_gpu
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_2_gpu(self):
"""Test Keras model with 2 GPUs."""
if context.num_gpus() < 2:
self.skipTest(
"{} GPUs are not available for this test. {} GPUs are available".
format(2, context.num_gpus()))
extra_flags = [
"-num_gpus", "2",
"-distribution_strategy", "mirrored",
"-model_dir", "keras_cifar_2_gpu",
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=resnet_cifar_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
示例10: main
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def main(argv=None):
"""Runs all unit tests."""
return _googletest.main(argv)
示例11: testListTensors
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def testListTensors(self):
# Use shorthand alias for the command prefix.
out = self._registry.dispatch_command("lt", [])
assert_listed_tensors(self, out, [
"simple_mul_add/u:0", "simple_mul_add/v:0", "simple_mul_add/u/read:0",
"simple_mul_add/v/read:0", "simple_mul_add/matmul:0",
"simple_mul_add/add:0"
], ["VariableV2", "VariableV2", "Identity", "Identity", "MatMul", "Add"])
# Check the main menu.
check_main_menu(self, out, list_tensors_enabled=False)
示例12: main
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def main():
"""Runs all unit tests."""
return _googletest.main()
示例13: test_end_to_end_no_dist_strat
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_no_dist_strat(self):
"""Test Keras model with 1 GPU, no distribution strategy."""
extra_flags = [
'-distribution_strategy', 'off',
'-model_dir', 'ctl_imagenet_no_dist_strat',
'-data_format', 'channels_last',
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=ctl_imagenet_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:17,代码来源:ctl_imagenet_test.py
示例14: test_end_to_end_graph_no_dist_strat
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_graph_no_dist_strat(self):
"""Test Keras model in legacy graph mode with 1 GPU, no dist strat."""
extra_flags = [
"-enable_eager", "false",
"-distribution_strategy", "off",
"-model_dir", "keras_cifar_graph_no_dist_strat",
"-data_format", "channels_last",
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=resnet_cifar_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)
开发者ID:ShivangShekhar,项目名称:Live-feed-object-device-identification-using-Tensorflow-and-OpenCV,代码行数:17,代码来源:resnet_cifar_test.py
示例15: test_end_to_end_no_dist_strat
# 需要导入模块: from tensorflow.python.platform import googletest [as 别名]
# 或者: from tensorflow.python.platform.googletest import main [as 别名]
def test_end_to_end_no_dist_strat(self):
"""Test Keras model with 1 GPU, no distribution strategy."""
extra_flags = [
"-distribution_strategy", "off",
"-model_dir", "keras_cifar_no_dist_strat",
"-data_format", "channels_last",
]
extra_flags = extra_flags + self._extra_flags
integration.run_synthetic(
main=resnet_cifar_main.run,
tmp_root=self.get_temp_dir(),
extra_flags=extra_flags
)