code: def run_forward(unit_test_class, test_params):
      device = test_params.device
  
      inputs = set_python_tensors_requires_grad(
          move_python_tensors_to_device(
              [
                  arg_value
                  for _, arg_value in test_params.arg_dict["input"]
              ],
              device,
          )
      )
      inputs += move_python_tensors_to_device(
          [
              arg_value
              for _, arg_value in test_params.arg_dict["target"]
          ],
          device,
      )
      inputs += move_python_tensors_to_device(
          [
              arg_value
              for _, arg_value in test_params.arg_dict["extra_args"]
          ],
          device,
      )
  
      # Some functionals (such as `F.rrelu`) create random tensors in their call path.
      # To make sure the random tensors created are the same in Python/C++, we need
      # to set the RNG seed manually.
      torch.manual_seed(0)
      python_output = test_params.test_instance.constructor()(*inputs)
  
      return python_output
  
file_path: pytorch/test/cpp_api_parity/functional_impl_check.py
imports: import tempfile
  from string import Template
  import re
  import pprint
  import os
  import torch
  from cpp_api_parity.utils import TorchNNFunctionalTestParams, TORCH_NN_COMMON_TEST_HARNESS, compile_cpp_code_inline, set_python_tensors_requires_grad, move_python_tensors_to_device, add_test, compute_cpp_args_construction_stmts_and_forward_arg_symbols, serialize_arg_dict_as_script_module, compute_arg_dict, decorate_test_fn, compute_temp_file_path, generate_error_msg, is_torch_nn_functional_test, try_remove_folder
  from cpp_api_parity.sample_functional import SAMPLE_FUNCTIONAL_CPP_SOURCE
label_desc: Use image node_id 1 for calling a global function with example usage: run_forward(unit_test_class, test_params) and returns: python_output