docstr: Pathching and unpatching tensors
  
  Args:
      stride: stride of the patcher
      pad_mode: how padding should be done. Defaults to "reflect".
  
  NOTE: this could potentially be implemented more efficiently with
      `torch.nn.functional.fold` and `unfold`
docstr_tok: ["Pathching","and","unpatching","tensors","Args",":","stride",":","stride","of","the","patcher","pad_mode",":","how","padding","should","be","done",".","Defaults","to","``","reflect","''",".","NOTE",":","this","could","potentially","be","implemented","more","efficiently","with","`","torch.nn.functional.fold","`","and","`","unfold","`"]
code: def __init__(self, stride: int, pad_mode: str = "reflect") -> None:
      """Pathching and unpatching tensors
  
      Args:
          stride: stride of the patcher
          pad_mode: how padding should be done. Defaults to "reflect".
  
      NOTE: this could potentially be implemented more efficiently with
          `torch.nn.functional.fold` and `unfold`
      """
      super().__init__()
      self.stride = stride
      self.pad_mode = pad_mode
  
file_path: NeuralCompression/projects/torch_vct/neural/patcher.py
imports: import math
  from typing import NamedTuple, Optional, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
label_desc: Use image node_id 1 to create a new Patcher object from inherited base classes: nn with example: obj = Patcher(stride, pad_mode)