docstr: Convert RGB image to grayscale
  
  Arguments
  ---------
  keep_channels : boolean
      If true, will keep all 3 channels and they will be the same
      If false, will just return 1 grayscale channel
code: def __init__(self, keep_channels=False):
      """
      Convert RGB image to grayscale
  
      Arguments
      ---------
      keep_channels : boolean
          If true, will keep all 3 channels and they will be the same
          If false, will just return 1 grayscale channel
      """
      self.keep_channels = keep_channels
      if keep_channels:
          self.channels = 3
      else:
          self.channels = 1
  
imports: import random
  import torch
  from torchvision.transforms.functional import to_tensor
  import numpy
  from ..utils import th_random_choice
label_desc: Use image node_id 1 to create a new Grayscale object  with example: obj = Grayscale(keep_channels)