title: Windows in tensorflow dataset with sequence AND constant input
body: <p>I have a dataset of the following form:</p>
  <pre><code>import tensorflow as tf
  
  num_inputs = 3
  num_outputs = 5
  num_params = 5
  num_samples = 32
  sequence_length = 50
  
  input_sequences = tf.random.normal((num_samples, sequence_length, num_inputs))
  output_sequences = tf.random.normal((num_samples, sequence_length, num_outputs))
  input_params = tf.random.normal((num_samples, num_params))
  
  dataset = tf.data.Dataset.from_tensor_slices((
      {'sequence': input_sequences, 'parameters': input_params},
      output_sequences
      ))
  </code></pre>
  <p>And I want to train a model on this that takes two inputs: a window of say 10 consecutive steps in a sequence, and the corresponding parameters (which do not have a sequence dimension, but vary from sample to sample). It should output the 10th step of the output sequence.</p>
  <p>So I want to create from this a new dataset of samples of the form</p>
  <pre><code>windows = {'sequence': (10 steps), 'parameters': (single constant vector of parameters)}, (single output step 10)
  </code></pre>
  <p>What is the clean way to do this, ideally without just copying the sequence into many overlapping windows, and for each window copying the corresponding parameters.</p>
  <p>I know there is the <a href="https://www.tensorflow.org/api_docs/python/tf/data/Dataset#window" rel="nofollow noreferrer">window</a> method, but I don't know how to apply it to this case. All the examples I've seen just apply it to a toy dataset that has only one type of data, not an input and output, never mind two inputs as here.</p>