code: def _reset_parameters(self):
      constant_init(self.sampling_offsets.weight, value=0.0)
      thetas = paddle.arange(self.n_heads, dtype="float32") * (
          2.0 * math.pi / self.n_heads
      )
      grid_init = paddle.stack([thetas.cos(), thetas.sin()], -1)
      grid_init = (
          (grid_init / grid_init.abs().max(-1, keepdim=True)[0])
          .reshape([self.n_heads, 1, 1, 2])
          .tile([1, self.n_levels, self.n_points, 1])
      )
      for i in range(self.n_points):
          grid_init[:, :, i, :] *= i + 1
  
      grid_init = grid_init.reshape([-1])
      self.sampling_offsets.bias = self.create_parameter(
          shape=grid_init.shape,
          default_initializer=paddle.nn.initializer.Assign(grid_init),
      )
      self.sampling_offsets.bias.stop_gradient = True
  
      constant_init(self.attention_weights.weight, value=0.0)
      constant_init(self.attention_weights.bias, value=0.0)
      xavier_uniform(self.value_proj.weight)
      constant_init(self.value_proj.bias, value=0.0)
      xavier_uniform(self.output_proj.weight)
      constant_init(self.output_proj.bias, value=0.0)
  
file_path: PaddleSeg/paddleseg/models/layers/ms_deformable_attention.py
imports: import math
  import warnings
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import param_init
  from paddleseg.cvlibs.param_init import constant_init, xavier_uniform
label_desc: Use image node_id 3 for calling the MSDeformAttn obj's underlying member method code with example usage: obj._reset_parameters() without return types