code: def build_P_paddle(self, I_r_size):
      I_r_height, I_r_width = I_r_size
      I_r_grid_x = (
          paddle.arange(-I_r_width, I_r_width, 2, dtype="float64") + 1.0
      ) / paddle.to_tensor(np.array([I_r_width]))
  
      I_r_grid_y = (
          paddle.arange(-I_r_height, I_r_height, 2, dtype="float64")
          + 1.0
      ) / paddle.to_tensor(np.array([I_r_height]))
  
      # P: self.I_r_width x self.I_r_height x 2
      P = paddle.stack(paddle.meshgrid(I_r_grid_x, I_r_grid_y), axis=2)
      P = paddle.transpose(P, perm=[1, 0, 2])
      # n (= self.I_r_width x self.I_r_height) x 2
      return P.reshape([-1, 2])
  
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 4 for calling the GridGenerator obj's underlying member method code with example usage: obj.build_P_paddle(I_r_size) and returns: P