code: def uniform_filter(data, size=7, res_g=None, sub_blocks=(1, 1, 1), normalized = True):
      
  
      if normalized:
          if np.isscalar(size):
              norm = size
          else:
              norm = np.int32(np.prod(size))**(1./len(size))
          FUNC = "res+val/%s"%norm
      else:
          FUNC = "res+val"
  
      if data.ndim == 2:
          _filt = make_filter(_generic_filter_gpu_2d(FUNC=FUNC, DEFAULT="0"))
      elif data.ndim == 3:
          _filt = make_filter(_generic_filter_gpu_3d(FUNC=FUNC, DEFAULT="0"))
  
      res =  _filt(data=data, size=size, res_g=res_g, sub_blocks=sub_blocks)
  
      return res
docs: mean filter of given size
  
      Parameters
      ----------
      data: 2 or 3 dimensional ndarray or OCLArray of type float32
          input data
      size: scalar, tuple
          the size of the patch to consider
      res_g: OCLArray
          store result in buffer if given
      sub_blocks:
          perform over subblock tiling (only if data is ndarray)
      normalized: bool
          if True, the filter corresponds to mean
          if False, the filter corresponds to sum
  
      Returns
      -------
          filtered image or None (if OCLArray)