def vectorize(*args, **kwargs):
    """
    Allows using `@vectorize` as well as `@vectorize()`.
    """
    if args and callable(args[0]):
        # Guessing the argument is the method.
        return _vectorize(args[0])
    else:
        # Wait for the second call.
        return lambda m: _vectorize(m, *args, **kwargs)