lazyslide.models.base.ModelBase#

class ModelBase#

Bases: ABC

classmethod check_input_tile(tile_spec)#

A helper function to check if the input tile size is valid.

Return True if the input tile size is valid. And the model will be executed. Add a warning here if the input is not optimal but still can be executed.

estimate_flops(*args, method='forward', **kwargs)#

Count the number of flops in a model.

estimate_param_size()#

Count the number of parameters in a model.