class_docstr: Grid Generator of RARE, which produces P_prime by multiplying T with P 
class_docstr_tok: ["Grid","Generator","of","RARE",",","which","produces","P_prime","by","multiplying","T","with","P"]
docstr: Generate P_hat and inv_delta_C for later 
docstr_tok: ["Generate","P_hat","and","inv_delta_C","for","later"]
code: def __init__(self, F, I_r_size):
      """Generate P_hat and inv_delta_C for later"""
      super(GridGenerator, self).__init__()
      self.eps = 1e-6
      self.I_r_height, self.I_r_width = I_r_size
      self.F = F
      self.C = self._build_C(self.F)  # F x 2
      self.P = self._build_P(self.I_r_width, self.I_r_height)
      ## for multi-gpu, you need register buffer
      self.register_buffer(
          "inv_delta_C",
          torch.tensor(self._build_inv_delta_C(self.F, self.C)).float(),
      )  # F+3 x F+3
      self.register_buffer(
          "P_hat",
          torch.tensor(
              self._build_P_hat(self.F, self.C, self.P)
          ).float(),
      )
  
file_path: EasyOCR/trainer/modules/transformation.py
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new GridGenerator object from inherited base classes: nn with example: obj = GridGenerator(F, I_r_size)