title: Tensorflow tf.keras.layers.Reshape RNN/LSTM
body: <p>I have a dataset with multi variables, I'm trying to reshape to feed in a LSTM Neural Nets, but I'm struggle with reshape layer without success.</p>
  <p>My dataset has the shape (1921535, 6) and every 341 timesteps correspond to one sample. I'd like to reshape in (23, 341, 6) and feed it in the Model. Below my code.</p>
  <pre><code>def df_to_dataset(dataframe, batch_size):
     dataframe = dataframe.copy()
     labels = dataframe.pop('target')
     ds = tf.data.Dataset.from_tensor_slices((dict(dataframe), labels))
     ds = ds.batch(batch_size)
     return ds
  
  max_length = 341
  batch_size = 23
  
  train_ds = df_to_dataset(data, batch_size * max_length)
  
  model = tf.keras.Sequential([
     tf.keras.layers.Reshape((batch_size, max_length, 6), input_shape=(batch_size * max_length, 6)),
     tf.keras.layers.LSTM(40, return_sequences=True),
     tf.keras.layers.LSTM(40),
     tf.keras.layers.Dense(1)
     ])
  
  </code></pre>
  <p>When I run the code I've receive the following error:</p>
  <pre><code>InvalidArgumentError: Input to reshape is a tensor with 54901 values, but the requested shape has 369075894 [Op:Reshape]
  </code></pre>
  <p>Thanks in advance</p>