class_docstr: Calculate the weighted sum of two Tensors.
  
  The function calculates the weighted sum of two Tensors as follows:
  
  .. math::
      out = src1 * alpha + src2 * beta + gamma
  
  Args:
      alpha: weight of the src1 elements as Union[float, Tensor].
      beta: weight of the src2 elements as Union[float, Tensor].
      gamma: scalar added to each sum as Union[float, Tensor].
  
  Shape:
      - Input1: Tensor with an arbitrary shape, equal to shape of Input2.
      - Input2: Tensor with an arbitrary shape, equal to shape of Input1.
      - Output: Weighted tensor with shape equal to src1 and src2 shapes.
  
  Example:
      >>> input1 = torch.rand(1, 1, 5, 5)
      >>> input2 = torch.rand(1, 1, 5, 5)
      >>> output = AddWeighted(0.5, 0.5, 1.0)(input1, input2)
      >>> output.shape
      torch.Size([1, 1, 5, 5])
  
  Notes:
      Tensor alpha/beta/gamma have to be with shape broadcastable to src1 and src2 shapes.
code: def __init__(
      self,
      alpha: Union[float, Tensor],
      beta: Union[float, Tensor],
      gamma: Union[float, Tensor],
  ) -> None:
      super().__init__()
      self.alpha = alpha
      self.beta = beta
      self.gamma = gamma
  
file_path: kornia/kornia/enhance/core.py
imports: from typing import Union
  from kornia.core import Module, Tensor, tensor
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR
label_desc: Use image node_id 1 to create a new AddWeighted object from inherited base classes: Module with example: obj = AddWeighted(alpha, beta, gamma)