code: def _image_average(
      image: type_alias.TensorLike, size: int
  ) -> tf.Tensor:
      """Computes average over image patches.
  
      Args:
        image: A tensor of shape `[B, H, W, C]`.
        size: The size of the square patches.
  
      Returns:
        A tensor of shape `[B, H - pad, W - pad, C]`, where `pad` is `size - 1`.
      """
      return tf.nn.avg_pool2d(
          input=image,
          ksize=(1, size, size, 1),
          strides=(1, 1, 1, 1),
          padding="VALID",
      )
  
file_path: graphics/tensorflow_graphics/image/matting.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import List, Tuple, Union
  import numpy
  import tensorflow
  from tensorflow_graphics.math import vector
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 4 for calling a global function with example usage: _image_average(image, size) and returns: tf