def test(self, iters=None, **kwargs):
    self.env.reset_epoch(shuffle=(iters is not None))
    self.losses = []
    self.results = {}
    looped = False
    self.loss = 0
    if (iters is not None):
        for i in range(iters):
            for traj in self.rollout(**kwargs):
                self.loss = 0
                self.results[traj['instr_id']] = traj['path']
    else:
        while True:
            for traj in self.rollout(**kwargs):
                if (traj['instr_id'] in self.results):
                    looped = True
                else:
                    self.loss = 0
                    self.results[traj['instr_id']] = traj['path']
            if looped:
                break
def test(self, iters=None, **kwargs):
    self.env.reset_epoch(shuffle=(iters is not None))
    self.losses = []
    self.results = {}
    looped = False
    self.loss = 0
    if (iters is not None):
        for i in range(iters):
            for traj in self.rollout(**kwargs):
                self.loss = 0
                self.results[traj['instr_id']] = traj['path']
    else:
        while True:
            for traj in self.rollout(**kwargs):
                if (traj['instr_id'] in self.results):
                    looped = True
                else:
                    self.loss = 0
                    self.results[traj['instr_id']] = traj['path']
            if looped:
                break