浏览代码

comments and cleanup

/MLA-1734-demo-provider
Chris Elion 4 年前
当前提交
d2133d83
共有 2 个文件被更改,包括 10 次插入2 次删除
  1. 7
      ml-agents/mlagents/tf_utils/globals.py
  2. 5
      ml-agents/mlagents/trainers/policy/tf_policy.py

7
ml-agents/mlagents/tf_utils/globals.py


from typing import Optional
_rank: Optional[int] = None
_local_rank: Optional[int] = None
"""
Returns the rank (in the MPI sense) of the current process.
For local training, this will always be None.
If this needs to be used, it should be done from outside ml-agents.
:return:
"""
return _rank

5
ml-agents/mlagents/trainers/policy/tf_policy.py


functions to save/load models and create the input placeholders.
"""
broadcast_global_variables: Callable[[int], None] = lambda x: None
# Callback function used at the start of training to synchronize weights.
# By default, this nothing.
# If this needs to be used, it should be done from outside ml-agents.
broadcast_global_variables: Callable[[int], None] = lambda root_rank: None
def __init__(
self,

正在加载...
取消
保存