original_docstring: load an image and convert it to tensor
      Args:
          filename: image filename
          cfg: CfgNode
      return:
          torch.tensor
      
docstring: load an image and convert it to tensor
docstring_tokens: load an image and convert it to tensor
code: def image_loader(filename, cfg):
      '''load an image and convert it to tensor
      Args:
          filename: image filename
          cfg: CfgNode
      return:
          torch.tensor
      '''
      image = Image.open(filename).convert('RGB')
      mean = cfg.transforms.tensor.normalization.mean
      std = cfg.transforms.tensor.normalization.std
      img_size = cfg.input.size
  
      transform = transforms.Compose([
                  transforms.Resize(img_size),
                  transforms.ToTensor(),
                  transforms.Normalize(mean, std),
              ])
      image = transform(image)
      return image
code_tokens: def image_loader ( filename , cfg ) : image = Image . open ( filename ) . convert ( 'RGB' ) mean = cfg . transforms . tensor . normalization . mean std = cfg . transforms . tensor . normalization . std img_size = cfg . input . size transform = transforms . Compose ( [ transforms . Resize ( img_size ) , transforms . ToTensor ( ) , transforms . Normalize ( mean , std ) , ] ) image = transform ( image ) return image
short_docstring: load an image and convert it to tensor
short_docstring_tokens: load an image and convert it to tensor
comment: '''load an image and convert it to tensor
      Args:
          filename: image filename
          cfg: CfgNode
      return:
          torch.tensor
      '''