





'''simple docstring'''

import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation






class       _UpperCamelCase      (			unittest.TestCase			):






				'''simple docstring'''





				def        lowercase__   (				self    ):
											"""simple docstring"""
											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        lowercase__   (				self    ):
											"""simple docstring"""
											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        lowercase__   (				self    ):
											"""simple docstring"""
											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        lowercase__   (				self    ):
											"""simple docstring"""
											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'''

import qiskit







def a_     (    __UpperCAmelCase				,							__UpperCAmelCase					)				->					qiskit.result.counts.Counts:





			"""simple docstring"""







			snake_case:    Union[str, Any]      							=qiskit.Aer.get_backend('aer_simulator'					)

			# Create a Quantum Circuit acting on the q register
			snake_case:    Dict      							=qiskit.QuantumCircuit(__UpperCAmelCase				,							__UpperCAmelCase					)

			# Map the quantum measurement to the classical bits
			circuit.measure([0]				,							[0]					)

			# Execute the circuit on the simulator
			snake_case:    Dict      							=qiskit.execute(__UpperCAmelCase				,							__UpperCAmelCase				,							shots=10_00					)

			# Return the histogram data of the results of the experiment.
			return job.result().get_counts(__UpperCAmelCase					)


if __name__ == "__main__":
	print(F"""Total count for various states are: {single_qubit_measure(1, 1)}""")




