code: def spatial_average_3d(
      x: torch.Tensor, keepdim: bool = True
  ) -> torch.Tensor:
      return x.mean([2, 3, 4], keepdim=keepdim)
  
imports: from __future__ import annotations
  import warnings
  import torch
  import torch.nn
  from monai.utils import optional_import
  from monai.utils.enums import StrEnum
label_desc: Use image node_id 1 for calling a global function with example usage: spatial_average_3d(x, keepdim) and returns: x