keras/src/layers/reshaping/permute.py/Permute/compute_output_shape
class Permute:    def compute_output_shape(self, input_shape):
        output_shape = [input_shape[0]]
        for dim in self.dims:
            output_shape.append(input_shape[dim])
        return tuple(output_shape)