- 概览
- 安装
- 教程
- 算法接口文档
- 简易高效的并行接口
- APIS
- FREQUENTLY ASKED QUESTIONS
- EVOKIT
- 其他
- parl.algorithms.paddle.policy_gradient
- parl.algorithms.paddle.dqn
- parl.algorithms.paddle.ddpg
- parl.algorithms.paddle.ddqn
- parl.algorithms.paddle.oac
- parl.algorithms.paddle.a2c
- parl.algorithms.paddle.qmix
- parl.algorithms.paddle.td3
- parl.algorithms.paddle.sac
- parl.algorithms.paddle.ppo
- parl.algorithms.paddle.maddpg
- parl.core.paddle.model
- parl.core.paddle.algorithm
- parl.remote.remote_decorator
- parl.core.paddle.agent
- parl.remote.client
parl.remote_class
- class remote_class(*args, **kwargs)[源代码]¶
A Python decorator that enables a class to run all its functions remotely.
Each instance of the remote class can be seemed as a task submitted to the cluster by the global client, which is created automatically when we call parl.connect(master_address). After global client submits the task, the master node will send an available job address to this remote instance. Then the remote object will send local python files, class definition and initialization arguments to the related job.
In this way, we can run distributed applications easily and efficiently.
@parl.remote_class class Actor(object): def __init__(self, x): self.x = x def step(self): self.x += 1 return self.x actor = Actor() actor.step() # Set maximum memory usage to 300 MB for each object. @parl.remote_class(max_memory=300) class LimitedActor(object): ...
- 参数:
max_memory (float) – Maximum memory (MB) can be used by each remote instance, the unit is in MB and default value is none(unlimited).
n_gpu (int) – The number of GPUs required to run the remote instance.
- 返回:
A remote wrapper for the remote class.
- 抛出:
Exception – An exception is raised if the client is not created by parl.connect(master_address) beforehand.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论