src/transformers/models/oneformer/modeling_oneformer.py/OneFormerTextTransformer/forward
class OneFormerTextTransformer:    def forward(self, hidden_states: torch.Tensor):
        for layer in self.layers:
            if self.use_checkpoint:
                hidden_states = torch.utils.checkpoint.checkpoint(layer, hidden_states)
            else:
                hidden_states = layer(hidden_states)
        return hidden_states