Skip to content

Dummy TaskPool

The DummyTaskPool is used for debugging purposes. It inherits from the base TaskPool class.

Reference

DummyTaskPool

Bases: BaseTaskPool

This is a dummy task pool used for debugging purposes. It inherits from the base TaskPool class.

Source code in fusion_bench/taskpool/dummy.py
class DummyTaskPool(BaseTaskPool):
    """
    This is a dummy task pool used for debugging purposes. It inherits from the base TaskPool class.
    """

    def __init__(self, model_save_path: Optional[str] = None):
        super().__init__()
        self.model_save_path = model_save_path

    def evaluate(self, model):
        """
        Evaluate the given model.
        This method does nothing but print the parameters of the model in a human-readable format.

        Args:
            model: The model to evaluate.
        """
        print_parameters(model, is_human_readable=True)

        if self.model_save_path is not None:
            with timeit_context(f"Saving the model to {self.model_save_path}"):
                separate_save(model, self.model_save_path)

        return get_model_summary(model)
evaluate(model)

Evaluate the given model. This method does nothing but print the parameters of the model in a human-readable format.

Parameters:

  • model

    The model to evaluate.

Source code in fusion_bench/taskpool/dummy.py
def evaluate(self, model):
    """
    Evaluate the given model.
    This method does nothing but print the parameters of the model in a human-readable format.

    Args:
        model: The model to evaluate.
    """
    print_parameters(model, is_human_readable=True)

    if self.model_save_path is not None:
        with timeit_context(f"Saving the model to {self.model_save_path}"):
            separate_save(model, self.model_save_path)

    return get_model_summary(model)