
'''simple docstring'''
from cva import destroyAllWindows, imread, imshow, waitKey







def 		A_(     A						:		Tuple):
							# getting number of pixels in the image
							UpperCamelCase			,	UpperCamelCase   			=     img.shape[0], img.shape[1]

							# converting each pixel's color to its negative
							for i in range(A):
														for j in range(A):
																					UpperCamelCase   			=     [255, 255, 255] - img[i][j]

							return img


if __name__ == "__main__":
						# read original image
						lowerCAmelCase					:    int           = imread('image_data/lena.jpg', 1)

						# convert to its negative
						lowerCAmelCase					:    List[Any]           = convert_to_negative(img)

						# show result image
						imshow('negative of original image', img)
						waitKey(0)
						destroyAllWindows()









'''simple docstring'''





from typing import Optional, Union

import torch
from torch import nn

from ...configuration_utils import ConfigMixin, register_to_config
from ...models.modeling_utils import ModelMixin


class 					snake_case			(UpperCamelCase		,   UpperCamelCase ):



       @register_to_config
       def __init__(					self  ,UpperCAmelCase_ = 768  ,)	->				List[Any]:
           super().__init__()

           lowercase__									=    nn.Parameter(torch.zeros(1  ,UpperCAmelCase_   )   )
           lowercase__									=    nn.Parameter(torch.ones(1  ,UpperCAmelCase_   )   )



       def 				_a   (					self  ,UpperCAmelCase_ = None  ,UpperCAmelCase_ = None  ,)	->				Any:
           lowercase__									=    nn.Parameter(self.mean.to(UpperCAmelCase_   ).to(UpperCAmelCase_   )   )
           lowercase__									=    nn.Parameter(self.std.to(UpperCAmelCase_   ).to(UpperCAmelCase_   )   )
           return self



       def 				_a   (					self  ,UpperCAmelCase_   )	->				Tuple:
           lowercase__									=    (embeds - self.mean) * 1.0 / self.std
           return embeds







       def 				_a   (					self  ,UpperCAmelCase_   )	->				List[str]:
           lowercase__									=    (embeds * self.std) + self.mean
           return embeds




