This commit is contained in:
James Betker 2022-03-04 13:47:00 -07:00
parent 382681a35d
commit 6000580e2e

View File

@ -453,7 +453,7 @@ class ExtensibleTrainer(BaseModel):
for k, v in log.items():
if not isinstance(v, torch.Tensor):
continue
if v.len(v.shape) != 1 or v.dtype != torch.float:
if len(v.shape) != 1 or v.dtype != torch.float:
continue
distributed.all_reduce(v, op=distributed.ReduceOp.SUM)
log[k] = v / distributed.get_world_size()