def METHOD_NAME():
    import torch
    gpu_id = 0  # >=0 means GPU ID, -1 means CPU
    device = torch.device(f"cuda:{gpu_id}" if (torch.cuda.is_available() and (gpu_id >= 0)) else "cpu")
    from elegantrl.envs.CustomGymEnv import PendulumEnv
    env_class = PendulumEnv  # run a custom env: PendulumEnv, which based on OpenAI pendulum
    env_args = {
        'env_name': 'Pendulum',  # Apply torque on the free end to swing a pendulum into an upright position
        # Reward: r = -(theta + 0.1 * theta_dt + 0.001 * torque)
        'num_envs': 1,  # the number of sub envs in vectorized env. `num_envs=1` in single env.
        'state_dim': 3,  # the x-y coordinates of the pendulum's free end and its angular velocity.
        'action_dim': 1,  # the torque applied to free end of the pendulum
        'if_discrete': False  # continuous action space, symbols → direction, value → force
    }
    '''init'''
    from elegantrl.train.config import build_vec_env
    env = build_vec_env(env_class=env_class, env_args=env_args)
    act = torch.load(f"./Pendulum_PPO_0/act.pt", map_location=device)
    '''evaluate'''
    eval_times = 2 ** 7
    from elegantrl.train.evaluator_vec_env import get_rewards_and_step
    rewards_step_list = [get_rewards_and_step(env, act) for _ in range(eval_times)]
    rewards_step_ten = torch.tensor(rewards_step_list)
    print(f"\n| average cumulative_returns {rewards_step_ten[:, 0].mean().item():9.3f}"
          f"\n| average      episode steps {rewards_step_ten[:, 1].mean().item():9.3f}")
    '''render'''
    if_discrete = env.if_discrete
    device = next(act.parameters()).device  # net.parameters() is a Python generator.
    state = env.reset()
    steps = None
    returns = 0.0  # sum of rewards in an episode
    for steps in range(12345):
        s_tensor = torch.as_tensor(state, dtype=torch.float32, device=device).unsqueeze(0)
        a_tensor = act(s_tensor).argmax(dim=1) if if_discrete else act(s_tensor)
        action = a_tensor.detach().cpu().numpy()[0]  # not need detach(), because using torch.no_grad() outside
        state, reward, done, _ = env.step(action)
        returns += reward
        env.render()
        if done:
            break
    returns = getattr(env, 'cumulative_rewards', returns)
    steps += 1
    print(f"\n| cumulative_returns {returns}"
          f"\n|      episode steps {steps}")