當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。