code: def _get_num_channels(tens: Tensor) -> int:
      r"""
      We assume only images of 1 and 3 channels
      """
      if len(tens.shape) == 3 and tens.shape[2] == 3:
          return 3
      else:
          return 1
  
imports: import cv2
  import random
  import math
  import numpy
  from ..coreten import Tensor, to_tensor
  from ..annotations import Tuple, Union
  from ..color import to_hls, to_rgb, to_bgr, to_hsv, to_gray, to_lab
label_desc: Use image node_id 6 for calling a global function with example usage: _get_num_channels(tens) and returns: int, int