def test_globalpooling_1d_masking_support(self):
    model = keras.Sequential()
    model.add(keras.layers.Masking(mask_value=0., input_shape=(None, 4)))
    model.add(keras.layers.GlobalAveragePooling1D())
    model.compile(loss='mae', optimizer='rmsprop')

    model_input = np.random.random((2, 3, 4))
    model_input[0, 1:, :] = 0
    output = model.predict(model_input)
    self.assertAllClose(output[0], model_input[0, 0, :])