Unverified Commit 8b67f209 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Fix memory leak issue in `torch_fx` tests (#18547)


Co-authored-by: default avatarLysandre Debut <hi@lysand.re>
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent b10a3b37
......@@ -859,6 +859,10 @@ class ModelTesterMixin:
f"serialized model {i}th output doesn't match model {i}th output for {model_class}",
)
# Avoid memory leak. Without this, each call increase RAM usage by ~20MB.
# (Even with this call, there are still memory leak by ~0.04MB)
self.clear_torch_jit_class_registry()
def test_headmasking(self):
if not self.test_head_masking:
return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment