code: 
  
  
  import torch
  import torch.nn.functional as F
  
  from diffusers import VQDiffusionScheduler
  
  from .test_schedulers import SchedulerCommonTest
  
  class 						A__      (					snake_case__			):
  
  
  
  
  
  
  
      """simple docstring"""
  
      __magic_name__    						=	(VQDiffusionScheduler,)
      def 	a_    ( self    ,      **__snake_case					):
           snake_case					=       {
               '''num_vec_classes''': 4_0_9_7,
               '''num_train_timesteps''': 1_0_0,
           }
  
           config.update(**__snake_case					)
           return config
      def 	a_    ( self    ,      __snake_case					):
           snake_case					=       4
           snake_case					=       8
           snake_case					=       8
  
           snake_case					=       torch.randint(0    ,      __snake_case    ,      (batch_size, height * width)					)
  
           return sample
      @property
      def 	a_    ( self					):
           assert False
      def 	a_    ( self    ,      __snake_case					):
           def model(__snake_case    ,      __snake_case    ,      *__snake_case					):
                snake_case				,						snake_case					=       sample.shape
                snake_case					=       torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels)					)
                snake_case					=       F.log_softmax(logits.double()    ,      dim=1					).float()
                return return_value
  
           return model
      def 	a_    ( self					):
           for timesteps in [2, 5, 1_0_0, 1_0_0_0]:
                self.check_over_configs(num_train_timesteps=__snake_case					)
      def 	a_    ( self					):
           for num_vec_classes in [5, 1_0_0, 1_0_0_0, 4_0_0_0]:
                self.check_over_configs(num_vec_classes=__snake_case					)
      def 	a_    ( self					):
           for t in [0, 5_0, 9_9]:
                self.check_over_forward(time_step=__snake_case					)
  
  
  
  
      def 	a_    ( self					):
           pass
  
  
  
  
  
style_context: 
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import (
      OptionalDependencyNotAvailable,
      _LazyModule,
      is_tf_available,
      is_tokenizers_available,
      is_torch_available,
  )
  
  
  _SCREAMING_SNAKE_CASE    :				Optional[int]       =					{
      "configuration_layoutlm": ["LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "LayoutLMConfig", "LayoutLMOnnxConfig"],
      "tokenization_layoutlm": ["LayoutLMTokenizer"],
  }
  
  try:
   if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   _SCREAMING_SNAKE_CASE    :				str       =					["LayoutLMTokenizerFast"]
  
  try:
   if not is_torch_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   _SCREAMING_SNAKE_CASE    :				List[str]       =					[
       "LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST",
       "LayoutLMForMaskedLM",
       "LayoutLMForSequenceClassification",
       "LayoutLMForTokenClassification",
       "LayoutLMForQuestionAnswering",
       "LayoutLMModel",
       "LayoutLMPreTrainedModel",
   ]
  
  try:
   if not is_tf_available():
    raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
   pass
  else:
   _SCREAMING_SNAKE_CASE    :				Optional[int]       =					[
       "TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST",
       "TFLayoutLMForMaskedLM",
       "TFLayoutLMForSequenceClassification",
       "TFLayoutLMForTokenClassification",
       "TFLayoutLMForQuestionAnswering",
       "TFLayoutLMMainLayer",
       "TFLayoutLMModel",
       "TFLayoutLMPreTrainedModel",
   ]
  
  
  if TYPE_CHECKING:
   from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig, LayoutLMOnnxConfig
   from .tokenization_layoutlm import LayoutLMTokenizer
  
   try:
    if not is_tokenizers_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .tokenization_layoutlm_fast import LayoutLMTokenizerFast
  
   try:
    if not is_torch_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .modeling_layoutlm import (
        LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST,
        LayoutLMForMaskedLM,
        LayoutLMForQuestionAnswering,
        LayoutLMForSequenceClassification,
        LayoutLMForTokenClassification,
        LayoutLMModel,
        LayoutLMPreTrainedModel,
    )
   try:
    if not is_tf_available():
     raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
    pass
   else:
    from .modeling_tf_layoutlm import (
        TF_LAYOUTLM_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFLayoutLMForMaskedLM,
        TFLayoutLMForQuestionAnswering,
        TFLayoutLMForSequenceClassification,
        TFLayoutLMForTokenClassification,
        TFLayoutLMMainLayer,
        TFLayoutLMModel,
        TFLayoutLMPreTrainedModel,
    )
  
  else:
   import sys
  
   _SCREAMING_SNAKE_CASE    :				Optional[int]       =					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
  
  
  
  
  