forked from mrq/DL-Art-School
df
This commit is contained in:
parent
382681a35d
commit
6000580e2e
|
@ -453,7 +453,7 @@ class ExtensibleTrainer(BaseModel):
|
||||||
for k, v in log.items():
|
for k, v in log.items():
|
||||||
if not isinstance(v, torch.Tensor):
|
if not isinstance(v, torch.Tensor):
|
||||||
continue
|
continue
|
||||||
if v.len(v.shape) != 1 or v.dtype != torch.float:
|
if len(v.shape) != 1 or v.dtype != torch.float:
|
||||||
continue
|
continue
|
||||||
distributed.all_reduce(v, op=distributed.ReduceOp.SUM)
|
distributed.all_reduce(v, op=distributed.ReduceOp.SUM)
|
||||||
log[k] = v / distributed.get_world_size()
|
log[k] = v / distributed.get_world_size()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user