def METHOD_NAME(
    test_case,
    device_type,
    dtype,
    in_shape,
    quantization_bit,
    quantization_scheme,
    quantization_formula,
    per_layer_quantization,
):
    input = (np.random.random(in_shape) - 0.5).astype(type_name_to_np_type[dtype])
    input_tensor = flow.tensor(
        input, dtype=flow.float32, requires_grad=True, device=flow.device(device_type)
    )
    min_max_observer = flow.nn.MinMaxObserver(
        quantization_formula=quantization_formula,
        quantization_bit=quantization_bit,
        quantization_scheme=quantization_scheme,
        per_layer_quantization=per_layer_quantization,
    )
    (scale, zero_point) = min_max_observer(input_tensor)
    fake_quantization = flow.nn.FakeQuantization(
        quantization_formula=quantization_formula,
        quantization_bit=quantization_bit,
        quantization_scheme=quantization_scheme,
    )
    output_tensor = fake_quantization(input_tensor, scale, zero_point)
    y = output_tensor.mean()
    y = y.backward()
    out = output_tensor.numpy()
    input_diff = input_tensor.grad.numpy()
    _check_fake_quantize(
        test_case,
        input,
        input_diff.flatten(),
        out.flatten(),
        quantization_bit,
        quantization_scheme,
        quantization_formula,
        per_layer_quantization,
    )