code: 
  
  
  '''simple docstring'''
  
  import torch
  import torch.nn.functional as F
  
  from diffusers import VQDiffusionScheduler
  
  from .test_schedulers import SchedulerCommonTest
  class 						__lowerCAmelCase		(lowercase_  ):
  
  
  
  
  
        '''simple docstring'''
  
  
  
  
  
  
        lowerCAmelCase__      :  List[str]						      =							(VQDiffusionScheduler,)
  
  
  
        def    UpperCamelCase__	(self					:					str     ,		**UpperCamelCase					:					Tuple				):
  
               '''simple docstring'''
  
  
  
  
  
  
  
               lowercase__       =				{
                   '''num_vec_classes''': 4097,
                   '''num_train_timesteps''': 100,
               }
  
               config.update(**UpperCamelCase				)
               return config
  
  
  
        def    UpperCamelCase__	(self					:					Dict     ,		UpperCamelCase					:					Optional[int]				):
  
               '''simple docstring'''
  
  
  
  
  
  
  
               lowercase__       =				4
               lowercase__       =				8
               lowercase__       =				8
  
               lowercase__       =				torch.randint(0     ,		UpperCamelCase     ,		(batch_size, height * width)				)
  
               return sample
  
  
  
        @property
        def    UpperCamelCase__	(self					:					Tuple				):
  
               '''simple docstring'''
  
  
  
  
  
  
  
               assert False
  
  
  
        def    UpperCamelCase__	(self					:					Dict     ,		UpperCamelCase					:					Any				):
  
               '''simple docstring'''
  
  
  
  
  
  
  
               def model(UpperCamelCase					:					Tuple     ,		UpperCamelCase					:					Union[str, Any]     ,		*UpperCamelCase					:					Dict				):
                      lowercase__    ,lowercase__       =				sample.shape
                      lowercase__       =				torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels)				)
                      lowercase__       =				F.log_softmax(logits.double()     ,		dim=1				).float()
                      return return_value
  
               return model
  
  
  
        def    UpperCamelCase__	(self					:					int				):
  
               '''simple docstring'''
  
  
  
  
  
  
  
               for timesteps in [2, 5, 100, 1000]:
                      self.check_over_configs(num_train_timesteps=UpperCamelCase				)
  
  
  
        def    UpperCamelCase__	(self					:					Optional[int]				):
  
               '''simple docstring'''
  
  
  
  
  
  
  
               for num_vec_classes in [5, 100, 1000, 4000]:
                      self.check_over_configs(num_vec_classes=UpperCamelCase				)
  
  
  
        def    UpperCamelCase__	(self					:					Optional[int]				):
  
               '''simple docstring'''
  
  
  
  
  
  
  
               for t in [0, 50, 99]:
                      self.check_over_forward(time_step=UpperCamelCase				)
  
  
  
  
  
  
        def    UpperCamelCase__	(self					:					Tuple				):
  
               '''simple docstring'''
  
  
  
  
  
  
  
               pass
  
  
  
  
  
style_context: 
  
  
  '''simple docstring'''
  
  from typing import TYPE_CHECKING
  
  from ...utils import (
      OptionalDependencyNotAvailable,
      _LazyModule,
      is_torch_available,
      is_vision_available,
  )
  
  
  lowerCamelCase							:     Optional[Any]								=			{
      'configuration_mobilevitv2': [
          'MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP',
          'MobileViTV2Config',
          'MobileViTV2OnnxConfig',
      ],
  }
  
  
  try:
   if not is_torch_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   lowerCamelCase							:     Optional[int]								=			[
       'MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST',
       'MobileViTV2ForImageClassification',
       'MobileViTV2ForSemanticSegmentation',
       'MobileViTV2Model',
       'MobileViTV2PreTrainedModel',
   ]
  
  if TYPE_CHECKING:
   from .configuration_mobilevitva import (
       MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP,
       MobileViTVaConfig,
       MobileViTVaOnnxConfig,
   )
  
   try:
    if not is_torch_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .modeling_mobilevitva import (
        MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST,
        MobileViTVaForImageClassification,
        MobileViTVaForSemanticSegmentation,
        MobileViTVaModel,
        MobileViTVaPreTrainedModel,
    )
  
  else:
   import sys
  
   lowerCamelCase							:     Dict								=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
  
  
  
  
  