code: def restore_policy_from_checkpoint(export_dir):
      # Load the model from the checkpoint.
      policy = Policy.from_checkpoint(export_dir)
      # Perform a dummy (CartPole) forward pass.
      test_obs = np.array([0.1, 0.2, 0.3, 0.4])
      results = policy.compute_single_action(test_obs)
      # Check results for correctness.
      assert len(results) == 3
      assert results[0].shape == ()  # pure single action (int)
      assert results[1] == []  # RNN states
      assert results[2]["action_dist_inputs"].shape == (2,)
  
file_path: ray/rllib/examples/export/cartpole_dqn_export.py
imports: import numpy
  import os
  import ray
  from ray.rllib.policy.policy import Policy
  from ray.rllib.utils.framework import try_import_tf
  from ray.tune.registry import get_trainable_cls
label_desc: Use image node_id 3 for calling a global function with example usage: restore_policy_from_checkpoint(export_dir) without return types