一个你从未见过的爱尔兰:爱尔兰岛的时光之旅

paddle.distributed.rpc. get_worker_info ( name: str ) WorkerInfo [source]
百度 当天上午,科技部火炬中心和长城战略咨询在北京联合发布的《2017中国独角兽企业发展报告》显示,中国独角兽企业共有164家,总估值达6284亿美元。

Get worker information by worker name. Warning: All RPC API should only be used internally within a secure network environment and must not be accessible via the public internet.

Parameters

name (str) – name of the worker.

Returns

class WorkerInfo with attribute name, rank, ip and port.

Examples

>>> 
>>> import paddle.distributed.rpc as rpc
>>> import os

>>> os.environ["PADDLE_WORKER_ENDPOINT"] = "127.0.0.1:9002"
>>> rpc.init_rpc("worker0", rank=0, world_size=1,
...             master_endpoint="127.0.0.1:8005")

>>> print(rpc.get_worker_info("worker0"))
{name: worker0, rank: 0, ip: 127.0.0.1, port: 9002}

>>> rpc.shutdown()