title: Formatting inputs for LSTM layer with variable timestep using Tensorflow
body: <p>According to documentation, the LSTM layer should handle inputs with (None, CONST, CONST) shape. For <strong>variable timestep</strong>, it should be able to handle inputs with <strong>(None, None, CONST) shape</strong>.</p>
  
  <p>Let say my data is the following :</p>
  
  <pre><code>X = [
      [
          [1, 2, 3],
          [4, 5, 6]
      ],
      [
          [7, 8, 9]
      ]
  ]
  Y = [0, 1]
  </code></pre>
  
  <p>And my model :</p>
  
  <pre><code>model = tf.keras.models.Sequential([
      tf.keras.layers.LSTM(32, activation='tanh',input_shape=(None, 3)),
      tf.keras.layers.Dense(1, activation='sigmoid')
  ])
  model.compile(loss='categorical_crossentropy', optimizer='adam')
  model.fit(X, Y)
  </code></pre>
  
  <p>My question is: <strong>how should I format these inputs</strong> to make this code work ?</p>
  
  <p>I cannot use pandas dataframes here, as I was used to. If I run the code above, I get this error : </p>
  
  <pre><code>Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 1 array(s), but instead got the following list of 2 arrays:
  </code></pre>
  
  <p>And if I change the last line with :</p>
  
  <pre><code>model.fit(np.array(X), np.array(Y))
  </code></pre>
  
  <p>The error is now :</p>
  
  <pre><code>Error when checking input: expected lstm_8_input to have 3 dimensions, but got array with shape (2, 1)
  </code></pre>