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 Grid from batch_C_prime [batch_size x F x 2] 
docstr_tok: ["Generate","Grid","from","batch_C_prime","[","batch_size","x","F","x","2","]"]
code: def build_P_prime(self, batch_C_prime):
      """Generate Grid from batch_C_prime [batch_size x F x 2]"""
      batch_size = batch_C_prime.size(0)
      batch_inv_delta_C = self.inv_delta_C.repeat(batch_size, 1, 1)
      batch_P_hat = self.P_hat.repeat(batch_size, 1, 1)
      batch_C_prime_with_zeros = torch.cat(
          (
              batch_C_prime,
              torch.zeros(batch_size, 3, 2).float().to(device),
          ),
          dim=1,
      )  # batch_size x F+3 x 2
      batch_T = torch.bmm(
          batch_inv_delta_C, batch_C_prime_with_zeros
      )  # batch_size x F+3 x 2
      batch_P_prime = torch.bmm(
          batch_P_hat, batch_T
      )  # batch_size x n x 2
      return batch_P_prime
  
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 6 for calling the GridGenerator obj's underlying member method code with example usage: obj.build_P_prime(batch_C_prime) and returns: batch_P_prime