code: def mean_flat(tensor):
      """
      Take the mean over all non-batch dimensions.
      """
      return tensor.mean(axis=list(range(1, len(tensor.shape))))
  
file_path: PaddleHub/modules/image/text_to_image/disco_diffusion_clip_rn101/reverse_diffusion/model/nn.py
imports: import math
  import paddle
  import paddle.nn
label_desc: Use image node_id 7 for calling a global function with example usage: mean_flat(tensor) and returns: tensor