class_docstr: Module that combine patches from tensors.
  
  In the simplest case, the output value of the operator with input size
  :math:`(B, N, C, H_{out}, W_{out})` is :math:`(B, C, H, W)`.
  
  where
    - :math:`B` is the batch size.
    - :math:`N` denotes the total number of extracted patches stacked in
    - :math:`C` denotes the number of input channels.
    - :math:`H`, :math:`W` the input height and width of the input in pixels.
    - :math:`H_{out}`, :math:`W_{out}` denote to denote to the patch size
      defined in the function signature.
      left-right and top-bottom order.
  
  * :attr:`original_size` is the size of the original image prior to
    extracting tensor patches and defines the shape of the output patch.
  * :attr:`window_size` is the size of the sliding window used while
    extracting tensor patches.
  * :attr:`stride` controls the stride to apply to the sliding window and
    regulates the overlapping between the extracted patches.
  * :attr:`unpadding` is the amount of padding to be removed. This value
    must be the same as padding used while extracting tensor patches.
  
  The parameters :attr:`original_size`, :attr:`window_size`, :attr:`stride`, and :attr:`unpadding` can
  be either:
  
      - a single ``int`` -- in which case the same value is used for the
        height and width dimension.
      - a ``tuple`` of two ints -- in which case, the first `int` is used for
        the height dimension, and the second `int` for the width dimension.
  
  Args:
      patches: patched tensor.
      original_size: the size of the original tensor and the output patch size.
      window_size: the size of the sliding window used.
      stride: stride of the sliding window.
      unpadding: remove the padding added to both side of the input.
  
  Shape:
      - Input: :math:`(B, N, C, H_{out}, W_{out})`
      - Output: :math:`(B, C, H, W)`
  
  Example:
      >>> out = extract_tensor_patches(torch.arange(16).view(1, 1, 4, 4), window_size=(2, 2), stride=(2, 2))
      >>> combine_tensor_patches(out, original_size=(4, 4), window_size=(2, 2), stride=(2, 2))
      tensor([[[[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11],
                [12, 13, 14, 15]]]])
  
  .. note::
      This function is supposed to be used in conjunction with :class:`ExtractTensorPatches`.
class_docstr_tok: ["Module","that","combine","patches","from","tensors",".","In","the","simplest","case",",","the","output","value","of","the","operator","with","input","size",":","math",":","`","(","B",",","N",",","C",",","H_","{","out","}",",","W_","{","out","}",")","`","is",":","math",":","`","(","B",",","C",",","H",",","W",")","`",".","where","-",":","math",":","`","B","`","is","the","batch","size",".","-",":","math",":","`","N","`","denotes","the","total","number","of","extracted","patches","stacked","in","-",":","math",":","`","C","`","denotes","the","number","of","input","channels",".","-",":","math",":","`","H","`",",",":","math",":","`","W","`","the","input","height","and","width","of","the","input","in","pixels",".","-",":","math",":","`","H_","{","out","}","`",",",":","math",":","`","W_","{","out","}","`","denote","to","denote","to","the","patch","size","defined","in","the","function","signature",".","left-right","and","top-bottom","order",".","*",":","attr",":","`","original_size","`","is","the","size","of","the","original","image","prior","to","extracting","tensor","patches","and","defines","the","shape","of","the","output","patch",".","*",":","attr",":","`","window_size","`","is","the","size","of","the","sliding","window","used","while","extracting","tensor","patches",".","*",":","attr",":","`","stride","`","controls","the","stride","to","apply","to","the","sliding","window","and","regulates","the","overlapping","between","the","extracted","patches",".","*",":","attr",":","`","unpadding","`","is","the","amount","of","padding","to","be","removed",".","This","value","must","be","the","same","as","padding","used","while","extracting","tensor","patches",".","The","parameters",":","attr",":","`","original_size","`",",",":","attr",":","`","window_size","`",",",":","attr",":","`","stride","`",",","and",":","attr",":","`","unpadding","`","can","be","either",":","-","a","single","``","int","``","--","in","which","case","the","same","value","is","used","for","the","height","and","width","dimension",".","-","a","``","tuple","``","of","two","ints","--","in","which","case",",","the","first","`","int","`","is","used","for","the","height","dimension",",","and","the","second","`","int","`","for","the","width","dimension",".","Args",":","patches",":","patched","tensor",".","original_size",":","the","size","of","the","original","tensor","and","the","output","patch","size",".","window_size",":","the","size","of","the","sliding","window","used",".","stride",":","stride","of","the","sliding","window",".","unpadding",":","remove","the","padding","added","to","both","side","of","the","input",".","Shape",":","-","Input",":",":","math",":","`","(","B",",","N",",","C",",","H_","{","out","}",",","W_","{","out","}",")","`","-","Output",":",":","math",":","`","(","B",",","C",",","H",",","W",")","`","Example",":",">",">",">","out","=","extract_tensor_patches","(","torch.arange","(","16",")",".view","(","1",",","1",",","4",",","4",")",",","window_size=","(","2",",","2",")",",","stride=","(","2",",","2",")",")",">",">",">","combine_tensor_patches","(","out",",","original_size=","(","4",",","4",")",",","window_size=","(","2",",","2",")",",","stride=","(","2",",","2",")",")","tensor","(","[","[","[","[","0",",","1",",","2",",","3","]",",","[","4",",","5",",","6",",","7","]",",","[","8",",","9",",","10",",","11","]",",","[","12",",","13",",","14",",","15","]","]","]","]",")","..","note",":",":","This","function","is","supposed","to","be","used","in","conjunction","with",":","class",":","`","ExtractTensorPatches","`","."]
code: def forward(self, input: Tensor) -> Tensor:
      return combine_tensor_patches(
          input,
          self.original_size,
          self.window_size,
          stride=self.stride,
          unpadding=self.unpadding,
      )
  
file_path: kornia/kornia/contrib/extract_patches.py
imports: import math
  from typing import Optional, Tuple, Union, cast
  import torch
  import torch.nn.functional
  from torch.nn.modules.utils import _pair
  from kornia.core import Module, Tensor, pad
label_desc: Use image node_id 2 for calling the CombineTensorPatches obj's underlying member method code with example usage: obj.forward(input) and returns: combine_tensor_patches