parameters: (env, agent, num_episodes)
return_statement: return rewards / num_episodes
docstring: Evaluates `agent` for `num_episodes`.
docstring_summary: Evaluates `agent` for `num_episodes`.
docstring_tokens: Evaluates agent for num_episodes .
function: def eval_agent(env, agent, num_episodes):
    """Evaluates `agent` for `num_episodes`."""
    rewards = 0.0
    for _ in range(num_episodes):
      time_step = env.reset()
      episode_reward = 0
      while not time_step.last():
        agent_output = agent.step(time_step, is_evaluation=True)
        time_step = env.step([agent_output.action])
        episode_reward += time_step.rewards[0]
      rewards += episode_reward
    return rewards / num_episodes
function_tokens: def eval_agent ( env , agent , num_episodes ) : rewards = 0.0 for _ in range ( num_episodes ) : time_step = env . reset ( ) episode_reward = 0 while not time_step . last ( ) : agent_output = agent . step ( time_step , is_evaluation = True ) time_step = env . step ( [ agent_output . action ] ) episode_reward += time_step . rewards [ 0 ] rewards += episode_reward return rewards / num_episodes