


'''simple docstring'''







import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest
class    lowercase_	(       a__  ):
    __UpperCAmelCase       =      (VQDiffusionScheduler,)


    def   __a				(	self    ,   **a       ):
          UpperCamelCase__      =							{
              "num_vec_classes": 40_97,
              "num_train_timesteps": 1_00,
          }

          config.update(**a       )
          return config


    def   __a				(	self    ,   a       ):
          UpperCamelCase__      =							4
          UpperCamelCase__      =							8
          UpperCamelCase__      =							8

          UpperCamelCase__      =							torch.randint(0    ,   a    ,   (batch_size, height * width)       )

          return sample


    @property
    def   __a				(	self       ):
          assert False


    def   __a				(	self    ,   a       ):
          def model(a    ,   a    ,   *a       ):
                UpperCamelCase__   ,      UpperCamelCase__      =							sample.shape
                UpperCamelCase__      =							torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels)       )
                UpperCamelCase__      =							F.log_softmax(logits.double()    ,   dim=1       ).float()
                return return_value

          return model


    def   __a				(	self       ):
          for timesteps in [2, 5, 1_00, 10_00]:
                self.check_over_configs(num_train_timesteps=a       )


    def   __a				(	self       ):
          for num_vec_classes in [5, 1_00, 10_00, 40_00]:
                self.check_over_configs(num_vec_classes=a       )


    def   __a				(	self       ):
          for t in [0, 50, 99]:
                self.check_over_forward(time_step=a       )


    def   __a				(	self       ):
          pass









'''simple docstring'''







import itertools







def _UpperCamelCase			(	__A = 1000000       )				->						int:


      '''simple docstring'''



      UpperCamelCase__      =							[1]

      for i in itertools.count(len(__A       )       ):
            UpperCamelCase__      =							0
            for j in itertools.count(1       ):
                  UpperCamelCase__      =							-1 if j % 2 == 0 else +1
                  UpperCamelCase__      =							(j * j * 3 - j) // 2
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number
                  index += j
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number

            if item == 0:
                  return i
            partitions.append(__A       )

      return 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  print(F"""{solution() = }""")





