in mae_envs/wrappers/multi_agent.py [0:0]
def observation(self, observation):
if self.flatten:
other_obs = [observation[k].reshape((observation[k].shape[0], -1))
for k in self.keys_other]
obs = np.concatenate([observation[k] for k in self.keys_self] + other_obs, axis=-1)
return {'observation_self': obs}
else:
obs = np.concatenate([observation[k] for k in self.keys_self], -1)
obs = {'observation_self': obs}
other_obs = {k: v for k, v in observation.items() if k in self.keys_other}
obs.update(other_obs)
return obs