title: Cartesian product when dimension is None
body: <p>This is related to an implementation issue in TensorFlow. I have a tensor <code>H</code> of size <code>(batch_size, time_steps, 256)</code> (but <code>batch_size</code> and <code>time_steps</code> are <code>None</code> during build time).</p>
  
  <p>I want to compute a tensor <code>A</code> of the shape <code>(batch_size, time_steps, time_steps, n_dim)</code> which is a Cartesian product across the time dimension. Thus, in simple terms:</p>
  
  <pre><code>A[:,i,j,:] = some_func(H[:,i,:], H[:,j,:])
  </code></pre>
  
  <p>Since the number of time_steps is <code>None</code> at time of building graph, what would be an elegant way to compute <code>A</code>?</p>