def METHOD_NAME(seed, base_axis, weight_shape, num_bits,
                                     bias, inq_iterations, ctx, func_name):
    from nbla_test_utils import function_tester
    rng = np.random.RandomState(seed)
    # Input
    inputs = [rng.randn(2, 3, 4).astype(np.float32)]
    # Weights
    inputs += [rng.randn(*weight_shape).astype(np.float32)]
    # Indices
    inputs += [np.random.randint(2, size=weight_shape)]
    # Bias
    if bias:
        inputs += [rng.randn(*weight_shape[1:]).astype(np.float32)]
    else:
        inputs += [None]
    selection_algorithm = 'largest_abs'
    function_tester(rng, F.inq_affine, ref_inq_affine, inputs,
                    func_args=[base_axis, num_bits,
                               inq_iterations, selection_algorithm, seed],
                    atol_b=1e-2, backward=[True, True, False, True], ctx=ctx, func_name=func_name,
                    ref_grad=ref_grad_inq_affine)