code: def ref_grad_fixed_point_quantize(
      x, dy, sign, n, delta, quantize, ste_fine_grained, **kw
  ):
      if not ste_fine_grained:
          return dy.flatten()
  
      dx = dy.copy()
      ref_delta = delta
      if sign:
          ref_max = ((1 << (n - 1)) - 1.0) * ref_delta
          ref_min = -ref_max
      else:
          ref_max = ((1 << n) - 1.0) * ref_delta
          ref_min = 0.0
  
      dy[np.where(x > ref_max)] = 0.0
      dy[np.where(x < ref_min)] = 0.0
      return dy.flatten()
  
file_path: nnabla/python/test/function/test_fixed_point_quantize.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context
label_desc: Use image node_id 2 for calling a global function with example usage: ref_grad_fixed_point_quantize(x, dy, sign, n, delta, quantize, ste_fine_grained) and returns: dy, dy