dmx.compressor.modeling.model.DmxConfigRule
- class dmx.compressor.modeling.model.DmxConfigRule(module_types=(), name_re: str = '', module_config: DmxModuleConfig = {})
This is a rule that specifies how to transform from DmxConfig to DmxConfig This defines the ‘action’ in the state space
- Parameters:
module_types (Optional[Tuple]) – Types of modules to apply transformation. Defaults to empty Tuple.
name_re (Optional[str]) – String for matching module name patterns. Defaults to empty str.
module_config (Optional[DmxModuleConfig]) – DmxModuleConfig that specifies the ops formats for a module. Defaults to empty DmxModuleConfig.
- module_types
Types of modules to apply transformation.
- Type:
Tuple
- name_rule
Pattern for matching module names.
- Type:
Pattern
- module_config
DmxModuleConfig that specifies the ops formats for a module.
- Type:
- __init__(module_types=(), name_re: str = '', module_config: DmxModuleConfig = {}) None
Methods
__init__([module_types, name_re, module_config])apply_to(model_or_config)A function that sets format of ops according to self.module_config for modules selected by self.module_types and self.name_rule on a model or DmxConfig
names_in(model_or_config)Creates a list of module names where the modules are in self.module_types and the names match with self.name_rule.