title: Lasagne layer whose output shape depends on the input value and not its input shape
body: <p>I am working on a project with lasagne and theano and need to create a custom layer.
  The output of this layer does not however depend on the size of the input, but on the values of the input...
  I know that keras (only with the tensorflow backend) offers the possibility of lambda layers, and I managed to write an expression which allowed me to have the output depending on the values of the input. But I don't know how or even if it is possible to do so using lasagne and theano.</p>
  
  <p>For example: if my input tensor has a fixed size of 100 values, but I know that at the end there could be some 0 values, which do not influence the output of the network at all, how can I remove those values and let only the values with information go further to the next layer? 
  I would like to minimize the space requirements of the network :)</p>
  
  <p>Is there a possibility to have a layer in lasagne like that? If so, how should I write the get_output_shape_for() method?
  If not, I'll switch to keras and tensorflow :D</p>
  
  <p>Thanks in advance!</p>