def _dotProdsWithAllWindows(x, X): """Slide x along the columns of X and compute the dot product""" return sig.correlate2d(X, x, mode='valid').flatten()