def test_fit_with_tuple_and_dict_dataset_inputs(self):
    with self.cached_session():
        model = multi_input_output_model()
        optimizer = gradient_descent.GradientDescentOptimizer(learning_rate=0.001)
        loss = 'mse'
        metrics = ['mae', keras.metrics.CategoricalAccuracy()]
        strategy = mirrored_strategy.MirroredStrategy(['/device:GPU:0', '/device:CPU:0'])
        model.compile(optimizer, loss, metrics=metrics, distribute=strategy)
        input_a_np = np.random.random((10, 3))
        input_b_np = np.random.random((10, 5))
        output_d_np = np.random.random((10, 7))
        output_e_np = np.random.random((10, 7))
        dataset_tuple = dataset_ops.Dataset.from_tensor_slices(((input_a_np, input_b_np), (output_d_np, output_e_np)))
        dataset_tuple = dataset_tuple.repeat(100)
        dataset_tuple = dataset_tuple.batch(10)
        model.fit(dataset_tuple, epochs=1, steps_per_epoch=2, verbose=1)
        dataset_dict = dataset_ops.Dataset.from_tensor_slices(({'input_a': input_a_np, 'input_b': input_b_np}, (output_d_np, output_e_np)))
        dataset_dict = dataset_dict.repeat(100)
        dataset_dict = dataset_dict.batch(10)
        model.fit(dataset_dict, epochs=1, steps_per_epoch=2, verbose=1)
def test_fit_with_tuple_and_dict_dataset_inputs(self):
    with self.cached_session():
        model = multi_input_output_model()
        optimizer = gradient_descent.GradientDescentOptimizer(learning_rate=0.001)
        loss = 'mse'
        metrics = ['mae', keras.metrics.CategoricalAccuracy()]
        strategy = mirrored_strategy.MirroredStrategy(['/device:GPU:0', '/device:CPU:0'])
        model.compile(optimizer, loss, metrics=metrics, distribute=strategy)
        input_a_np = np.random.random((10, 3))
        input_b_np = np.random.random((10, 5))
        output_d_np = np.random.random((10, 7))
        output_e_np = np.random.random((10, 7))
        dataset_tuple = dataset_ops.Dataset.from_tensor_slices(((input_a_np, input_b_np), (output_d_np, output_e_np)))
        dataset_tuple = dataset_tuple.repeat(100)
        dataset_tuple = dataset_tuple.batch(10)
        model.fit(dataset_tuple, epochs=1, steps_per_epoch=2, verbose=1)
        dataset_dict = dataset_ops.Dataset.from_tensor_slices(({'input_a': input_a_np, 'input_b': input_b_np}, (output_d_np, output_e_np)))
        dataset_dict = dataset_dict.repeat(100)
        dataset_dict = dataset_dict.batch(10)
        model.fit(dataset_dict, epochs=1, steps_per_epoch=2, verbose=1)