(self, listener: TransformerListener, component_name: str)
Add a listener for a downstream component. Usually internals.
Add a listener for a downstream component. Usually internals.
Add a listener for a downstream component . Usually internals .
def add_listener(self, listener: TransformerListener, component_name: str) -> None:
        """Add a listener for a downstream component. Usually internals."""
        self.listener_map.setdefault(component_name, [])
        if listener not in self.listener_map[component_name]:
            self.listener_map[component_name].append(listener)
        if self.model.has_dim("nO") and listener.has_dim("nO") is None:
            listener.set_dim("nO", self.model.get_dim("nO"))
def add_listener ( self , listener : TransformerListener , component_name : str ) -> None : self . listener_map . setdefault ( component_name , [ ] ) if listener not in self . listener_map [ component_name ] : self . listener_map [ component_name ] . append ( listener ) if self . model . has_dim ( "nO" ) and listener . has_dim ( "nO" ) is None : listener . set_dim ( "nO" , self . model . get_dim ( "nO" ) )