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


Python googletest.main方法代码示例

本文整理汇总了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) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:21,代码来源:curses_ui_test.py

示例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
    ) 
开发者ID:tensorflow,项目名称:models,代码行数:23,代码来源:resnet_cifar_test.py

示例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
    ) 
开发者ID:tensorflow,项目名称:models,代码行数:23,代码来源:resnet_cifar_test.py

示例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
    ) 
开发者ID:tensorflow,项目名称:models,代码行数:22,代码来源:resnet_cifar_test.py

示例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) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:5,代码来源:test.py

示例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) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:14,代码来源:analyzer_cli_test.py

示例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() 
开发者ID:tobegit3hub,项目名称:deep_image_model,代码行数:5,代码来源:test.py

示例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
    ) 
开发者ID:tensorflow,项目名称:models,代码行数:17,代码来源:resnet_cifar_test.py


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