code: def check_forward_equal_with_paddle_float():
      value, sampling_locations, attention_weights = get_test_tensors(c)
  
      output_paddle = (
          ms_deform_attn_core_paddle(
              value,
              spatial_shapes,
              level_start_index,
              sampling_locations,
              attention_weights,
          )
          .detach()
          .cpu()
      )
      output_cuda = (
          ms_deformable_attn(
              value,
              spatial_shapes,
              level_start_index,
              sampling_locations,
              attention_weights,
          )
          .detach()
          .cpu()
      )
      fwdok = paddle.allclose(
          output_cuda, output_paddle, rtol=1e-2, atol=1e-3
      ).item()
      max_abs_err = (output_cuda - output_paddle).abs().max().item()
      max_rel_err = (
          ((output_cuda - output_paddle).abs() / output_paddle.abs())
          .max()
          .item()
      )
  
      print(
          f"*{fwdok} check_forward_equal_with_paddle_float: max_abs_err {max_abs_err:.2e} max_rel_err {max_rel_err:.2e}"
      )
  
file_path: PaddleDetection/ppdet/modeling/transformers/ext_op/test_ms_deformable_attn_op.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import os
  import sys
  import random
  import numpy
  import paddle
  from ppdet.modeling.transformers.utils import deformable_attention_core_func
label_desc: Use image node_id 2 for calling a global function with example usage: check_forward_equal_with_paddle_float() without return types