
"""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     ):



		def 						UpperCAmelCase							( self)	->	int:






							'''simple docstring'''
							_UpperCamelCase										=  torch.nn.Linear(10    ,		10)
							_UpperCamelCase										=  torch.optim.SGD(model.parameters()    ,		0.1)
							_UpperCamelCase										=  Accelerator()
							_UpperCamelCase										=  accelerator.prepare(__a)
							try:
												pickle.loads(pickle.dumps(__a))
							except Exception as e:
												self.fail(F'''Accelerated optimizer pickling failed with {e}''')
							AcceleratorState._reset_state()








"""simple docstring"""





from ...utils import is_torch_available, is_transformers_available


if is_transformers_available() and is_torch_available():
				from .pipeline_vq_diffusion import LearnedClassifierFreeSamplingEmbeddings, VQDiffusionPipeline






