


import pickle
import unittest

import torch

from accelerate import Accelerator
from accelerate.state import AcceleratorState
from accelerate.test_utils import require_cpu






@require_cpu
class      UpperCamelCase(	unittest.TestCase ):


					def 				SCREAMING_SNAKE_CASE_	(    self						:		Any    )      ->						Optional[Any]:




											'''simple docstring'''

											__snake_case				=		torch.nn.Linear(1_0  ,     1_0    )
											__snake_case				=		torch.optim.SGD(model.parameters()  ,     0.1    )
											__snake_case				=		Accelerator()
											__snake_case				=		accelerator.prepare(SCREAMING_SNAKE_CASE    )
											try:
																	pickle.loads(pickle.dumps(SCREAMING_SNAKE_CASE    )    )
											except Exception as e:
																	self.fail(f'''Accelerated optimizer pickling failed with {e}'''    )
											AcceleratorState._reset_state()









from __future__ import annotations





def 						_lowerCAmelCase							(     _lowerCAmelCase			)    ->						list[int]:


						'''simple docstring'''






						__snake_case				=		2
						__snake_case				=		[]
						while i * i <= n:
												if n % i:
																		i += 1
												else:
																		n //= i
																		factors.append(_lowerCAmelCase			)
						if n > 1:
												factors.append(_lowerCAmelCase			)
						return factors


if __name__ == "__main__":
	import doctest

	doctest.testmod()





