浏览代码

detach masks

/develop/sac-targetq
Ervin Teng 4 年前
当前提交
3f7d815c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      ml-agents/mlagents/trainers/torch/utils.py

2
ml-agents/mlagents/trainers/torch/utils.py


:param masks: Boolean tensor of masks with same dimension as tensor.
"""
return (tensor.T * masks).sum() / torch.clamp(
(torch.ones_like(tensor.T) * masks).float().sum(), min=1.0
(torch.ones_like(tensor.T) * masks.detach()).float().sum(), min=1.0
)
正在加载...
取消
保存