@@ -771,7 +771,7 @@ def test_from_pipe_consistent_forward_pass(self, expected_max_diff=1e-3):
771771 ), "`from_pipe` changed the attention processor in original pipeline."
772772
773773 @unittest .skipIf (
774- torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.14.0" ),
774+ torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.14.0" ),
775775 reason = "CPU offload is only available with hardware accelerator and `accelerate v0.14.0` or higher" ,
776776 )
777777 def test_from_pipe_consistent_forward_pass_cpu_offload (self , expected_max_diff = 1e-3 ):
@@ -1317,7 +1317,7 @@ def test_save_load_optional_components(self, expected_max_difference=1e-4):
13171317 max_diff = np .abs (to_np (output ) - to_np (output_loaded )).max ()
13181318 self .assertLess (max_diff , expected_max_difference )
13191319
1320- @unittest .skipIf (torch_device = "cpu" , reason = "Hardware accelerator and CPU are required to switch devices" )
1320+ @unittest .skipIf (torch_device = "cpu" , reason = "Hardware accelerator and CPU are required to switch devices" )
13211321 def test_to_device (self ):
13221322 components = self .get_dummy_components ()
13231323 pipe = self .pipeline_class (** components )
@@ -1392,7 +1392,7 @@ def _test_attention_slicing_forward_pass(
13921392 assert_mean_pixel_difference (to_np (output_with_slicing2 [0 ]), to_np (output_without_slicing [0 ]))
13931393
13941394 @unittest .skipIf (
1395- torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.14.0" ),
1395+ torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.14.0" ),
13961396 reason = "CPU offload is only available with hardware accelerator and `accelerate v0.14.0` or higher" ,
13971397 )
13981398 def test_sequential_cpu_offload_forward_pass (self , expected_max_diff = 1e-4 ):
@@ -1455,7 +1455,7 @@ def test_sequential_cpu_offload_forward_pass(self, expected_max_diff=1e-4):
14551455 )
14561456
14571457 @unittest .skipIf (
1458- torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.17.0" ),
1458+ torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.17.0" ),
14591459 reason = "CPU offload is only available with hardware accelerator and `accelerate v0.17.0` or higher" ,
14601460 )
14611461 def test_model_cpu_offload_forward_pass (self , expected_max_diff = 2e-4 ):
@@ -1512,7 +1512,7 @@ def test_model_cpu_offload_forward_pass(self, expected_max_diff=2e-4):
15121512 )
15131513
15141514 @unittest .skipIf (
1515- torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.17.0" ),
1515+ torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.17.0" ),
15161516 reason = "CPU offload is only available with hardware accelerator and `accelerate v0.17.0` or higher" ,
15171517 )
15181518 def test_cpu_offload_forward_pass_twice (self , expected_max_diff = 2e-4 ):
@@ -1569,7 +1569,7 @@ def test_cpu_offload_forward_pass_twice(self, expected_max_diff=2e-4):
15691569 )
15701570
15711571 @unittest .skipIf (
1572- torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.14.0" ),
1572+ torch_device = "cpu" or not is_accelerate_available () or is_accelerate_version ("<" , "0.14.0" ),
15731573 reason = "CPU offload is only available with hardware accelerator and `accelerate v0.14.0` or higher" ,
15741574 )
15751575 def test_sequential_offload_forward_pass_twice (self , expected_max_diff = 2e-4 ):
0 commit comments