message: Added dtype compatibility tests.
  Updated the stack of tests on GaussianNoise and GaussianDropout layers.
  This both highlights issue and the validity of the suggested fix (PR
diff: @@ -18,6 +18,9 @@ from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  +import numpy as np
  +
  +from tensorflow.python import dtypes
  from tensorflow.python import keras
  from tensorflow.python.keras import keras_parameterized
  from tensorflow.python.keras import testing_utils
  @@ -31,19 +34,56 @@ class NoiseLayersTest(keras_parameterized.TestCase):
  testing_utils.layer_test(
  keras.layers.GaussianNoise,
  kwargs={'stddev': 1.},
  - input_shape=(3, 2, 3))
  + input_shape=(3, 2, 3)
  + )
  def test_GaussianDropout(self):
  testing_utils.layer_test(
  keras.layers.GaussianDropout,
  kwargs={'rate': 0.5},
  - input_shape=(3, 2, 3))
  + input_shape=(3, 2, 3)
  + )
  def test_AlphaDropout(self):
  testing_utils.layer_test(
  keras.layers.AlphaDropout,
  kwargs={'rate': 0.2},
  - input_shape=(3, 2, 3))
  + input_shape=(3, 2, 3)
  + )
  +
  + @staticmethod
  + def _make_model(dtype, gtype):
  + assert dtype in (dtypes.float32, dtypes.float64)
  + assert gtype in ('noise', 'dropout')
  + model = keras.Sequential()
  + model.add(keras.layers.Dense(8, input_shape=(32,), dtype=dtype))
  + if gtype == 'noise':
  + gaussian = keras.layers.GaussianNoise(0.0003)
  + else:
  + gaussian = keras.layers.GaussianDropout(0.1)
  + model.add(gaussian)
  + return model
  +
  + def _train_model(self, dtype, gtype):
  + model = self._make_model(dtype, gtype)
  + model.compile(
  + optimizer='sgd',
  + loss='mse',
  + run_eagerly=testing_utils.should_run_eagerly()
  + )
  + model.train_on_batch(np.zeros((8, 32)), np.zeros((8, 8)))
  +
  + def test_noise_float32(self):
  + self._train_model(dtypes.float32, 'noise')
  +
  + def test_noise_float64(self):
  + self._train_model(dtypes.float64, 'noise')
  +
  + def test_dropout_float32(self):
  + self._train_model(dtypes.float32, 'dropout')
  +
  + def test_dropout_float64(self):
  + self._train_model(dtypes.float64, 'dropout')
  if __name__ == '__main__':
  