code: def _blur2d(x, f=[1, 2, 1], normalize=True, flip=False, stride=1):
      assert x.shape.ndims == 4 and all(
          dim.value is not None for dim in x.shape[1:]
      )
      assert isinstance(stride, int) and stride >= 1
  
      # Finalize filter kernel.
      f = np.array(f, dtype=np.float32)
      if f.ndim == 1:
          f = f[:, np.newaxis] * f[np.newaxis, :]
      assert f.ndim == 2
      if normalize:
          f /= np.sum(f)
      if flip:
          f = f[::-1, ::-1]
      f = f[:, :, np.newaxis, np.newaxis]
      f = np.tile(f, [1, 1, int(x.shape[1]), 1])
  
      # No-op => early exit.
      if f.shape == (1, 1) and f[0, 0] == 1:
          return x
  
      # Convolve using depthwise_conv2d.
      orig_dtype = x.dtype
      x = tf.cast(
          x, tf.float32
      )  # tf.nn.depthwise_conv2d() doesn't support fp16
      f = tf.constant(f, dtype=x.dtype, name="filter")
      strides = [1, 1, stride, stride]
      x = tf.nn.depthwise_conv2d(
          x, f, strides=strides, padding="SAME", data_format="NCHW"
      )
      x = tf.cast(x, orig_dtype)
      return x
  
imports: import numpy
  import tensorflow
  import dnnlib
  import dnnlib.tflib
label_desc: Use image node_id 1 for calling a global function with example usage: _blur2d(x, f, normalize, flip, stride) and returns: x, x