

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    snake_case     (    unittest.TestCase  ):

				def 							lowercase_					(     self							:    int)->       str:



						'''simple docstring'''


						__lowerCAmelCase:	List[Any]   				=      torch.nn.Linear(1_0					,  1_0)
						__lowerCAmelCase:	List[str]   				=      torch.optim.SGD(model.parameters()					,  0.1)
						__lowerCAmelCase:	List[Any]   				=      Accelerator()
						__lowerCAmelCase:	int   				=      accelerator.prepare(_snake_case)
						try:
								pickle.loads(pickle.dumps(_snake_case))
						except Exception as e:
								self.fail(f"Accelerated optimizer pickling failed with {e}")
						AcceleratorState._reset_state()





"""simple docstring"""


def    a__   (   __SCREAMING_SNAKE_CASE ,			__SCREAMING_SNAKE_CASE			)     ->     int:
		return int((input_a, input_a).count(0			) == 0			)






def    a__   (   )     ->     None:
		assert and_gate(0 ,			0			) == 0
		assert and_gate(0 ,			1			) == 0
		assert and_gate(1 ,			0			) == 0
		assert and_gate(1 ,			1			) == 1


if __name__ == "__main__":
			test_and_gate()
			print(and_gate(1, 0))
			print(and_gate(0, 0))
			print(and_gate(0, 1))
			print(and_gate(1, 1))


