code: def geometric_mean(x: Tensor, dim: int) -> Tensor:
      """
      Compute geometric mean along given dimension.
      This implementation assume values are in range (0...1) (Probabilities)
      Args:
          x: Input tensor of arbitrary shape
          dim: Dimension to reduce
  
      Returns:
          Tensor
      """
      return x.log().mean(dim=dim).exp()
  
imports: import itertools
  from collections.abc import Sized, Iterable
  from typing import Union, Tuple
  import torch
  from torch import Tensor
  from ..utils.support import pytorch_toolbelt_deprecated
label_desc: Use image node_id 22 for calling a global function with example usage: geometric_mean(x, dim) and returns: x