def METHOD_NAME(func):
    def wrapper(self, **generate_inputs_kwargs):
        generate_inputs = getattr(self, generate_inputs_name)
        impl_np = func(self, numpy, **generate_inputs_kwargs)
        impl_cp = func(self, cupy, **generate_inputs_kwargs)
        # TODO(imanishi): Fix these workaround after `cupy.fuse`
        # supports lambda function.
        # If `cupy.fuse` supports lambda function, these lines can be
        # written more simply (as `impl_fuse_np = cupy.fuse(impl_np)`).
        @cupy.fuse()
        def impl_fuse_np(*args, **kwargs):
            return impl_np(*args, **kwargs)
        @cupy.fuse()
        def impl_fuse_cp(*args, **kwargs):
            return impl_cp(*args, **kwargs)
        args_np, kwargs_np = generate_inputs(
            numpy, *generate_inputs_args, **generate_inputs_kwargs)
        args_cp, kwargs_cp = generate_inputs(
            cupy, *generate_inputs_args, **generate_inputs_kwargs)
        args_fuse_np, kwargs_fuse_np = generate_inputs(
            numpy, *generate_inputs_args, **generate_inputs_kwargs)
        args_fuse_cp, kwargs_fuse_cp = generate_inputs(
            cupy, *generate_inputs_args, **generate_inputs_kwargs)
        result_np = call(impl_np, args_np, kwargs_np)
        result_cp = call(impl_cp, args_cp, kwargs_cp)
        result_fuse_np = call(impl_fuse_np, args_fuse_np, kwargs_fuse_np)
        result_fuse_cp = call(impl_fuse_cp, args_fuse_cp, kwargs_fuse_cp)
        check_result(cupy, result_cp, result_np)
        check_result(numpy, result_fuse_np, result_np)
        check_result(cupy, result_fuse_cp, result_np)
        _, err = result_np
        if err is None:
            check(cupy, args_cp, args_np)
            check(numpy, args_fuse_np, args_np)
            check(cupy, args_fuse_cp, args_np)
    return wrapper