mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
reset deterministic in tearDownClass (#11785)
* reset deterministic in tearDownClass Signed-off-by: jiqing-feng <jiqing.feng@intel.com> * fix deterministic setting Signed-off-by: jiqing-feng <jiqing.feng@intel.com> --------- Signed-off-by: jiqing-feng <jiqing.feng@intel.com> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
This commit is contained in:
@@ -98,7 +98,14 @@ class Base4bitTests(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
torch.use_deterministic_algorithms(True)
|
||||
cls.is_deterministic_enabled = torch.are_deterministic_algorithms_enabled()
|
||||
if not cls.is_deterministic_enabled:
|
||||
torch.use_deterministic_algorithms(True)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
if not cls.is_deterministic_enabled:
|
||||
torch.use_deterministic_algorithms(False)
|
||||
|
||||
def get_dummy_inputs(self):
|
||||
prompt_embeds = load_pt(
|
||||
|
||||
@@ -99,7 +99,14 @@ class Base8bitTests(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
torch.use_deterministic_algorithms(True)
|
||||
cls.is_deterministic_enabled = torch.are_deterministic_algorithms_enabled()
|
||||
if not cls.is_deterministic_enabled:
|
||||
torch.use_deterministic_algorithms(True)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
if not cls.is_deterministic_enabled:
|
||||
torch.use_deterministic_algorithms(False)
|
||||
|
||||
def get_dummy_inputs(self):
|
||||
prompt_embeds = load_pt(
|
||||
|
||||
Reference in New Issue
Block a user