keras/src/layers/rnn/stacked_rnn_cells.py/StackedRNNCells/output_size
class StackedRNNCells:    def output_size(self):
        if getattr(self.cells[-1], "output_size", None) is not None:
            return self.cells[-1].output_size
        elif isinstance(self.cells[-1].state_size, (list, tuple)):
            return self.cells[-1].state_size[0]
        else:
            return self.cells[-1].state_size