(self, layers)
return result
Groups patterns together in list. If pattern is [a, b], will transform
        [a, b, c, d, a, b, e] -> [[a, b], c, d, [a, b], e]. Support for multiple
        patterns.
Groups patterns together in list. If pattern is [a, b], will transform
        [a, b, c, d, a, b, e] -> [[a, b], c, d, [a, b], e]. Support for multiple
        patterns.
Groups patterns together in list . If pattern is [ a b ] will transform [ a b c d a b e ] - > [[ a b ] c d [ a b ] e ] . Support for multiple patterns .
def fusion_pass(self, layers):
        """
        Groups patterns together in list. If pattern is [a, b], will transform
        [a, b, c, d, a, b, e] -> [[a, b], c, d, [a, b], e]. Support for multiple
        patterns.
        """
        patterns = [lambda x, y: x['type'] == 'neon.layers.layer.Convolution' and
                    y['type'] == 'neon.layers.layer.Bias']

        result = []
        skip_next = False
        for (l1, l2) in pairwise(layers):
            if any([pattern(l1, l2) for pattern in patterns]):
                result.append([l1, l2])
                skip_next = True
            elif skip_next:
                skip_next = False
            else:
                result.append(l1)

        return result
def fusion_pass ( self , layers ) : patterns = [ lambda x , y : x [ 'type' ] == 'neon.layers.layer.Convolution' and y [ 'type' ] == 'neon.layers.layer.Bias' ] result = [ ] skip_next = False for ( l1 , l2 ) in pairwise ( layers ) : if any ( [ pattern ( l1 , l2 ) for pattern in patterns ] ) : result . append ( [ l1 , l2 ] ) skip_next = True elif skip_next : skip_next = False else : result . append ( l1 ) return result