def test_model_methods_with_eager_tensors_multi_io(self):
    a = keras.layers.Input(shape=(3,), name='input_a')
    b = keras.layers.Input(shape=(3,), name='input_b')
    dense = keras.layers.Dense(4, name='dense')
    c = dense(a)
    d = dense(b)
    e = keras.layers.Dropout(0.5, name='dropout')(c)
    model = keras.models.Model([a, b], [d, e])
    optimizer = RMSPropOptimizer(learning_rate=0.001)
    loss = 'mse'
    loss_weights = [1.0, 0.5]
    metrics = ['mae']
    model.compile(optimizer, loss, metrics=metrics, loss_weights=loss_weights, sample_weight_mode=None)
    input_a = keras.backend.zeros(shape=(10, 3))
    input_b = keras.backend.zeros(shape=(10, 3))
    target_d = keras.backend.zeros(shape=(10, 4))
    target_e = keras.backend.zeros(shape=(10, 4))
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=5, verbose=0)
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=5, verbose=0, shuffle=False)
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=2, verbose=0, validation_data=([input_a, input_b], [target_d, target_e]))
    model.train_on_batch([input_a, input_b], [target_d, target_e])
    model.predict([input_a, input_b], batch_size=5)
    model.evaluate([input_a, input_b], [target_d, target_e], batch_size=2, verbose=0)
    model.test_on_batch([input_a, input_b], [target_d, target_e])
    input_b = np.zeros(shape=(10, 3)).astype('float32')
    target_e = np.zeros(shape=(10, 4)).astype('float32')
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=5, verbose=0)
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=2, verbose=0, validation_data=([input_a, input_b], [target_d, target_e]))
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=5, verbose=0, shuffle=False)
    model.train_on_batch([input_a, input_b], [target_d, target_e])
    model.predict([input_a, input_b], batch_size=5)
    model.evaluate([input_a, input_b], [target_d, target_e], batch_size=2, verbose=0)
    model.test_on_batch([input_a, input_b], [target_d, target_e])
def test_model_methods_with_eager_tensors_multi_io(self):
    a = keras.layers.Input(shape=(3,), name='input_a')
    b = keras.layers.Input(shape=(3,), name='input_b')
    dense = keras.layers.Dense(4, name='dense')
    c = dense(a)
    d = dense(b)
    e = keras.layers.Dropout(0.5, name='dropout')(c)
    model = keras.models.Model([a, b], [d, e])
    optimizer = RMSPropOptimizer(learning_rate=0.001)
    loss = 'mse'
    loss_weights = [1.0, 0.5]
    metrics = ['mae']
    model.compile(optimizer, loss, metrics=metrics, loss_weights=loss_weights, sample_weight_mode=None)
    input_a = keras.backend.zeros(shape=(10, 3))
    input_b = keras.backend.zeros(shape=(10, 3))
    target_d = keras.backend.zeros(shape=(10, 4))
    target_e = keras.backend.zeros(shape=(10, 4))
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=5, verbose=0)
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=5, verbose=0, shuffle=False)
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=2, verbose=0, validation_data=([input_a, input_b], [target_d, target_e]))
    model.train_on_batch([input_a, input_b], [target_d, target_e])
    model.predict([input_a, input_b], batch_size=5)
    model.evaluate([input_a, input_b], [target_d, target_e], batch_size=2, verbose=0)
    model.test_on_batch([input_a, input_b], [target_d, target_e])
    input_b = np.zeros(shape=(10, 3)).astype('float32')
    target_e = np.zeros(shape=(10, 4)).astype('float32')
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=5, verbose=0)
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=2, verbose=0, validation_data=([input_a, input_b], [target_d, target_e]))
    model.fit([input_a, input_b], [target_d, target_e], epochs=1, batch_size=5, verbose=0, shuffle=False)
    model.train_on_batch([input_a, input_b], [target_d, target_e])
    model.predict([input_a, input_b], batch_size=5)
    model.evaluate([input_a, input_b], [target_d, target_e], batch_size=2, verbose=0)
    model.test_on_batch([input_a, input_b], [target_d, target_e])