code: def forward(self, image):
      image.stop_gradient = False
      batch_C_prime = self.loc_net(image)
      batch_P_prime = self.grid_generator(
          batch_C_prime, image.shape[2:]
      )
      batch_P_prime = batch_P_prime.reshape(
          [-1, image.shape[2], image.shape[3], 2]
      )
      is_fp16 = False
      if batch_P_prime.dtype != paddle.float32:
          data_type = batch_P_prime.dtype
          image = image.cast(paddle.float32)
          batch_P_prime = batch_P_prime.cast(paddle.float32)
          is_fp16 = True
      batch_I_r = F.grid_sample(x=image, grid=batch_P_prime)
      if is_fp16:
          batch_I_r = batch_I_r.cast(data_type)
  
      return batch_I_r
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  from paddle import nn, ParamAttr
  from paddle.nn import functional
  import numpy
label_desc: Use image node_id 2 for calling the TPS obj's underlying member method code with example usage: obj.forward(image) and returns: batch_I_r