keras/src/layers/reshaping/cropping3d.py/Cropping3D/compute_output_shape
class Cropping3D:    def compute_output_shape(self, input_shape):
        if self.data_format == "channels_first":
            spatial_dims = list(input_shape[2:5])
        else:
            spatial_dims = list(input_shape[1:4])

        for index in range(0, 3):
            if spatial_dims[index] is None:
                continue
            spatial_dims[index] -= sum(self.cropping[index])
            if spatial_dims[index] <= 0:
                raise ValueError(
                    "Values in `cropping` argument should be smaller than the "
                    "corresponding spatial dimension of the input. Received: "
                    f"input_shape={input_shape}, cropping={self.cropping}"
                )

        if self.data_format == "channels_first":
            return (input_shape[0], input_shape[1], *spatial_dims)
        else:
            return (input_shape[0], *spatial_dims, input_shape[4])