tristandeleu / pytorch-maml-rl

Reinforcement Learning with Model-Agnostic Meta-Learning in Pytorch
MIT License
827 stars 158 forks source link

What's the goal to close self.work_remotes in subproc_vec_env.py #12

Closed dragen1860 closed 6 years ago

dragen1860 commented 6 years ago

I found you establish 8 mp.Pipe() with

self.remotes, self.work_remotes = zip(*[mp.Pipe() for _ in env_factory])

But then you close all another duplex point by:

        for remote in self.work_remotes:
            remote.close()

I wonder could u explain this?

tristandeleu commented 6 years ago

I am not very familiar with this. But if I understand correctly, pipes are two way communication channels. In our case, we only need that communication to be one way, so we are closing one end of the pipes.