mirror of
https://github.com/huggingface/accelerate.git
synced 2025-10-20 18:13:46 +08:00
Fix: truth value of tensor with more than 1 variable is unambiguous
This commit is contained in:
@ -2862,7 +2862,7 @@ class Accelerator:
|
||||
self.unscale_gradients()
|
||||
parameters = [p for p in parameters]
|
||||
for model in self._models:
|
||||
if parameters == [p for p in model.parameters()]:
|
||||
if set(parameters) == set(model.parameters()):
|
||||
if not self.is_fsdp2:
|
||||
return model.clip_grad_norm_(max_norm, norm_type)
|
||||
else:
|
||||
|
Reference in New Issue
Block a user