def test_globalpooling_3d_keepdims(self):
    testing_utils.layer_test(
        keras.layers.pooling.GlobalMaxPooling3D,
        kwargs={'data_format': 'channels_first', 'keepdims': True},
        input_shape=(3, 4, 3, 4, 3),
        expected_output_shape=(None, 4, 1, 1, 1))
    testing_utils.layer_test(
        keras.layers.pooling.GlobalMaxPooling3D,
        kwargs={'data_format': 'channels_last', 'keepdims': True},
        input_shape=(3, 4, 3, 4, 3),
        expected_output_shape=(None, 1, 1, 1, 3))
    testing_utils.layer_test(
        keras.layers.pooling.GlobalAveragePooling3D,
        kwargs={'data_format': 'channels_first', 'keepdims': True},
        input_shape=(3, 4, 3, 4, 3),
        expected_output_shape=(None, 4, 1, 1, 1))
    testing_utils.layer_test(
        keras.layers.pooling.GlobalAveragePooling3D,
        kwargs={'data_format': 'channels_last', 'keepdims': True},
        input_shape=(3, 4, 3, 4, 3),
        expected_output_shape=(None, 1, 1, 1, 3))