def lstm_units(self): lstm = self.model.get_layer("lstm") if isinstance(lstm, Bidirectional): lstm = lstm.layer return lstm.units