Beispiel #1
0
    def test_set_quantization_dataset_path_on_empty_config(self) -> None:
        """Test set_quantization_dataset_path on empty config."""
        config = Config()

        config.set_quantization_dataset_path("new dataset path")

        self.assertIsNone(config.quantization)
Beispiel #2
0
    def test_set_quantization_dataset_path(self) -> None:
        """Test set_quantization_dataset_path."""
        config = Config(self.predefined_config)

        config.set_quantization_dataset_path("new dataset path")

        self.assertEqual(
            "/path/to/evaluation/dataset",
            config.evaluation.accuracy.dataloader.dataset.params.get("root"),
        )
        self.assertEqual(
            "/path/to/evaluation/dataset",
            config.evaluation.performance.dataloader.dataset.params.get(
                "root"),
        )
        self.assertEqual(
            "new dataset path",
            config.quantization.calibration.dataloader.dataset.params.get(
                "root"),
        )