code: def process_test_params_for_functional(
      test_params_dict, device, test_instance_class
  ):
      test_instance = test_instance_class(**test_params_dict)
      functional_name = compute_functional_name(test_params_dict)
      assert test_instance.get_name().startswith("test_")
      # Example output: `BCELoss_no_reduce_cuda`
      functional_variant_name = test_instance.get_name()[5:] + (
          ("_" + device) if device != "cpu" else ""
      )
      arg_dict = compute_arg_dict(test_params_dict, test_instance)
  
      return TorchNNFunctionalTestParams(
          functional_name=functional_name,
          functional_variant_name=functional_variant_name,
          test_instance=test_instance,
          cpp_function_call=compute_cpp_function_call(
              test_params_dict, arg_dict, functional_name
          ),
          arg_dict=arg_dict,
          has_parity=test_params_dict.get("has_parity", True),
          device=device,
          cpp_tmp_folder=tempfile.mkdtemp(),
      )
  
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 5 for calling a global function with example usage: process_test_params_for_functional(test_params_dict, device, test_instance_class) and returns: TorchNNFunctionalTestParams