Пример #1
0
 def test_initialize(self, dtype):
   config = base_configs.ExperimentConfig(
       runtime=base_configs.RuntimeConfig(
           enable_eager=False,
           enable_xla=False,
           gpu_threads_enabled=True,
           per_gpu_thread_count=1,
           gpu_thread_mode='gpu_private',
           num_gpus=1,
           dataset_num_private_threads=1,
       ),
       train_dataset=dataset_factory.DatasetConfig(dtype=dtype),
       model=base_configs.ModelConfig(
           loss=base_configs.LossConfig(loss_scale='dynamic')),
   )
   classifier_trainer.initialize(config)
Пример #2
0
  def test_initialize(self, dtype):
    config = base_configs.ExperimentConfig(
        runtime=base_configs.RuntimeConfig(
            run_eagerly=False,
            enable_xla=False,
            per_gpu_thread_count=1,
            gpu_thread_mode='gpu_private',
            num_gpus=1,
            dataset_num_private_threads=1,
        ),
        train_dataset=dataset_factory.DatasetConfig(dtype=dtype),
        model=base_configs.ModelConfig(),
    )

    class EmptyClass:
      pass
    fake_ds_builder = EmptyClass()
    fake_ds_builder.dtype = dtype
    fake_ds_builder.config = EmptyClass()
    classifier_trainer.initialize(config, fake_ds_builder)