mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Don't allow skipping deepcopy (#102973)
We might mutate it afterwards! This could lead to hard to understand bugs. Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/102973 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
7112880cc1
commit
cca7b38564
@ -1263,10 +1263,7 @@ class BenchmarkRunner:
|
||||
continue # bad benchmark implementation
|
||||
|
||||
def deepcopy_model(self, model):
|
||||
try:
|
||||
return copy.deepcopy(model)
|
||||
except TypeError:
|
||||
return model
|
||||
return copy.deepcopy(model)
|
||||
|
||||
def validate_model(self, model, example_inputs):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user