title: How to stack vectors in Theano without using scan?
body: <p>I am using theano.scan for creating stacked vector of contexts like this:</p>
  
  <pre><code>Y_, scan_updates = theano.scan(fn=lambda *args,**kwargs: T.concatenate(args, axis=0),outputs_info=None, sequences=dict(input = Y_, taps=range(-left_ctx,right_ctx+1)))
  </code></pre>
  
  <p>It seems that scan is so slow, that this slows down whole processing. 
  In signal processing this is fairly standard operation, so I was thinking about creating a special op, just for this. 
  Unfortunately, I would need also GPU implementation and grad for this op and it looks like a long shot for me. 
  Can you kick me in the right direction? I have already read Extending theano documentation, but still doesn't help a lot.</p>
  
  <p>Example:</p>
  
  <p>in case of </p>
  
  <pre><code>left_ctx=right_ctx=1
  </code></pre>
  
  <p>matrix:</p>
  
  <pre><code>[[0.0, 0.1],
   [1.0, 1.1],
   [2.0, 2.1],
   [3.0, 3.1]]
  </code></pre>
  
  <p>would be converted to </p>
  
  <pre><code>[[0.0, 0.1, 1.0, 1.1, 2.0, 2.1],
   [1.0, 1.1, 2.0, 2.1, 3.0, 3.1]]
  </code></pre>
  
  <p>Thank you
  J</p>