Description
For completeness why not? Old issue in theano: Theano/Theano#5365
If code is unclear, the idea is that the filter function returns a boolean mask by applying the filter function to each sequence. Then the boolean mask is used to index respective sequence to only return the values that passed the filter.
They were using nonzero because boolean indexing was not supported. It now is