title: Masking zeros in Keras Embedding layer
body: <p>Below is simplified version of problem I'm having.</p>
  
  <p>Sample data:</p>
  
  <pre><code>X = np.round(np.random.rand(10, 10) * 10).astype(np.int32)
  y = np.round(np.random.rand(10)).astype(np.int32)
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>i = Input(shape=(10,), name='sentence_input', dtype='int32')
  x = Embedding(1000, 10, mask_zero=True)(i)
  o = LSTM(10)(x)
  enc_model = Model(i, o)
  
  i2 = Input(shape=(10,), dtype='int32')
  x2 = enc_model(i2)
  o2 = Dense(1, activation='sigmoid')(x2)
  
  model = Model(i2, o2)
  model.compile(optimizer='rmsprop', loss='binary_crossentropy')
  model.fit(X, y, epochs=1)
  </code></pre>
  
  <p>I'm using Tensorflow 1.0.1 as Keras backend. Keras version 2.0. </p>
  
  <p>I want to add masking but the moment <code>mask_zero=True</code> is added, it fails with error:</p>
  
  <pre><code>InvalidArgumentError: You must feed a value for placeholder tensor 'sentence_input_10' with dtype int32
  [[Node: sentence_input_10 = Placeholder[dtype=DT_INT32, shape=[], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
  </code></pre>
  
  <p>I though adding <code>dtype='int32'</code> on both <code>Input</code> layers will fix the problem. </p>
  
  <p>I need to have <code>enc_model</code> as a separate <code>Model</code></p>