


import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation


class     __lowerCamelCase  (					unittest.TestCase				):

     '''simple docstring'''


     def 							_UpperCAmelCase      (      self							)       ->							Tuple:
          _a    	=				get_activation('''swish'''							)

          self.assertIsInstance(A__    ,				nn.SiLU							)

          self.assertEqual(act(torch.tensor(-100    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertNotEqual(act(torch.tensor(-1    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertEqual(act(torch.tensor(0    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertEqual(act(torch.tensor(20    ,				dtype=torch.floataa							)							).item()    ,				20							)


     def 							_UpperCAmelCase      (      self							)       ->							Optional[Any]:
          _a    	=				get_activation('''silu'''							)

          self.assertIsInstance(A__    ,				nn.SiLU							)

          self.assertEqual(act(torch.tensor(-100    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertNotEqual(act(torch.tensor(-1    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertEqual(act(torch.tensor(0    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertEqual(act(torch.tensor(20    ,				dtype=torch.floataa							)							).item()    ,				20							)


     def 							_UpperCAmelCase      (      self							)       ->							Optional[Any]:
          _a    	=				get_activation('''mish'''							)

          self.assertIsInstance(A__    ,				nn.Mish							)

          self.assertEqual(act(torch.tensor(-200    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertNotEqual(act(torch.tensor(-1    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertEqual(act(torch.tensor(0    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertEqual(act(torch.tensor(20    ,				dtype=torch.floataa							)							).item()    ,				20							)





     def 							_UpperCAmelCase      (      self							)       ->							Optional[int]:
          _a    	=				get_activation('''gelu'''							)

          self.assertIsInstance(A__    ,				nn.GELU							)

          self.assertEqual(act(torch.tensor(-100    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertNotEqual(act(torch.tensor(-1    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertEqual(act(torch.tensor(0    ,				dtype=torch.floataa							)							).item()    ,				0							)
          self.assertEqual(act(torch.tensor(20    ,				dtype=torch.floataa							)							).item()    ,				20							)



"""simple docstring"""






def       A_   (   _lowerCAmelCase     :					int = 10**12       ):






     """simple docstring"""

     _a    	=				1
     _a    	=				0

     _a    	=				1
     _a    	=				1

     while numerator <= 2 * min_total - 1:
          prev_numerator += 2 * numerator
          numerator += 2 * prev_numerator

          prev_denominator += 2 * denominator
          denominator += 2 * prev_denominator

     return (denominator + 1) // 2


if __name__ == "__main__":
   print(f'{solution() = }')