




'''simple docstring'''
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				):



					'''simple docstring'''





					def     __snake_case						(	self     :						str)    ->							Tuple:
								A_									= torch.nn.Linear(10      ,       10)
								A_									= torch.optim.SGD(model.parameters()      ,       0.1)
								A_									= Accelerator()
								A_									= accelerator.prepare(_lowercase)
								try:
											pickle.loads(pickle.dumps(_lowercase))
								except Exception as e:
											self.fail(F'Accelerated optimizer pickling failed with {e}')
								AcceleratorState._reset_state()










'''simple docstring'''
import numpy as np





def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		np.array:
			return 1 / (1 + np.exp(-vector     ))





def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		np.array:
			return vector * sigmoid(1.702 * vector     )


if __name__ == "__main__":
							import doctest

							doctest.testmod()




