class_docstr: See base class.
class_docstr_tok: ["See","base","class","."]
docstr: Horizontal flip image.
  
  Horizontally flip the given image randomly with a given probability and
  return both the resulting image and the location.
  
  Args:
      img (PIL Image or Tensor): Image to be flipped..
      Location: Location object linked to the image
  Returns:
      PIL Image or Tensor: Randomly flipped image
      Location: Location object with updated location.horizontal_flip parameter
docstr_tok: ["Horizontal","flip","image",".","Horizontally","flip","the","given","image","randomly","with","a","given","probability","and","return","both","the","resulting","image","and","the","location",".","Args",":","img","(","PIL","Image","or","Tensor",")",":","Image","to","be","flipped","..","Location",":","Location","object","linked","to","the","image","Returns",":","PIL","Image","or","Tensor",":","Randomly","flipped","image","Location",":","Location","object","with","updated","location.horizontal_flip","parameter"]
code: def forward(
      self, img: Image.Image, location: Location
  ) -> Tuple[Image.Image, Location]:
      """Horizontal flip image.
  
      Horizontally flip the given image randomly with a given probability and
      return both the resulting image and the location.
  
      Args:
          img (PIL Image or Tensor): Image to be flipped..
          Location: Location object linked to the image
      Returns:
          PIL Image or Tensor: Randomly flipped image
          Location: Location object with updated location.horizontal_flip parameter
      """
  
      if torch.rand(1) < self.p:
          img = F.hflip(img)
          location.horizontal_flip = True
      return img, location
  
imports: from dataclasses import dataclass
  from typing import Tuple
  import torch
  import torchvision.transforms
  import torchvision.transforms.functional
  from PIL import Image
  from torch import nn
label_desc: Use image node_id 1 for calling the RandomHorizontalFlipWithLocation obj's underlying member method code with example usage: obj.forward(img, location) and returns: img,  location