def test_unsupported_features(self):
    with self.cached_session():
        model = get_model()
        optimizer = gradient_descent.GradientDescentOptimizer(0.001)
        loss = 'mse'
        metrics = ['mae']
        strategy = mirrored_strategy.MirroredStrategy(['/device:GPU:1', '/device:GPU:0'])
        model.compile(optimizer, loss, metrics=metrics, distribute=strategy)
        dataset = get_dataset(strategy)
        with self.assertRaisesRegexp(ValueError, '`validation_split` argument is not supported when input `x` is a dataset or a dataset iterator.+'):
            model.fit(dataset, epochs=1, steps_per_epoch=2, verbose=0, validation_split=0.5, validation_steps=2)
        sample_weight = np.random.random((10,))
        with self.assertRaisesRegexp(ValueError, '`sample_weight` argument is not supported when input `x` is a dataset or a dataset iterator.'):
            model.fit(dataset, epochs=1, steps_per_epoch=2, verbose=0, sample_weight=sample_weight)
        with self.assertRaisesRegexp(ValueError, 'you should specify the `steps_per_epoch` argument'):
            model.fit(dataset, epochs=1, verbose=0)
        with self.assertRaisesRegexp(ValueError, 'you should specify the `steps` argument'):
            model.evaluate(dataset, verbose=0)
        with self.assertRaisesRegexp(ValueError, 'you should specify the `steps` argument'):
            model.predict(dataset, verbose=0)
def test_unsupported_features(self):
    with self.cached_session():
        model = get_model()
        optimizer = gradient_descent.GradientDescentOptimizer(0.001)
        loss = 'mse'
        metrics = ['mae']
        strategy = mirrored_strategy.MirroredStrategy(['/device:GPU:1', '/device:GPU:0'])
        model.compile(optimizer, loss, metrics=metrics, distribute=strategy)
        dataset = get_dataset(strategy)
        with self.assertRaisesRegexp(ValueError, '`validation_split` argument is not supported when input `x` is a dataset or a dataset iterator.+'):
            model.fit(dataset, epochs=1, steps_per_epoch=2, verbose=0, validation_split=0.5, validation_steps=2)
        sample_weight = np.random.random((10,))
        with self.assertRaisesRegexp(ValueError, '`sample_weight` argument is not supported when input `x` is a dataset or a dataset iterator.'):
            model.fit(dataset, epochs=1, steps_per_epoch=2, verbose=0, sample_weight=sample_weight)
        with self.assertRaisesRegexp(ValueError, 'you should specify the `steps_per_epoch` argument'):
            model.fit(dataset, epochs=1, verbose=0)
        with self.assertRaisesRegexp(ValueError, 'you should specify the `steps` argument'):
            model.evaluate(dataset, verbose=0)
        with self.assertRaisesRegexp(ValueError, 'you should specify the `steps` argument'):
            model.predict(dataset, verbose=0)