code: def _gather_channels(x, indexes, **kwargs):
      """Slice tensor along channels axis by given indexes"""
      backend = kwargs["backend"]
      if backend.image_data_format() == "channels_last":
          x = backend.permute_dimensions(x, (3, 0, 1, 2))
          x = backend.gather(x, indexes)
          x = backend.permute_dimensions(x, (1, 2, 3, 0))
      else:
          x = backend.permute_dimensions(x, (1, 0, 2, 3))
          x = backend.gather(x, indexes)
          x = backend.permute_dimensions(x, (1, 0, 2, 3))
      return x
  
file_path: segmentation_models/segmentation_models/base/functional.py
label_desc: Use image node_id 1 for calling a global function with example usage: _gather_channels(x, indexes) and returns: x