def _do_output_past(self, outputs):
        """During generation, decide whether to pass the `past` variable to the next forward pass."""
        has_output_past = getattr(self.config, "output_past", False)
        mem_len = getattr(self.config, "mem_len", 0)
        if len(outputs) <= 1:
            return False
        if mem_len > 0 or has_output_past:
            return True
        return False
During generation, decide whether to pass the `past` variable to the next forward pass.
xtune/src/transformers/modeling_utils.py