class_docstr: This layer upsamples a given input tensor.
  
  Args:
      size (Optional[Union[int, Tuple[int, ...]]): Output spatial size. Default: None
      scale_factor (Optional[float]): Scale each spatial dimension of the input by this factor. Default: None
      mode (Optional[str]): Upsampling algorithm (``'nearest'``, ``'linear'``, ``'bilinear'``, ``'bicubic'`` and ``'trilinear'``. Default: ``'nearest'``
      align_corners (Optional[bool]): if ``True``, the corner pixels of the input and output tensors are aligned, and thus preserving the values at
          those pixels. This only has effect when :attr:`mode` is ``'linear'``, ``'bilinear'``, ``'bicubic'``, or ``'trilinear'``.
          Default: ``None``
  
  Shape:
      - Input: :math:`(N, C, W_{in})` or :math:`(N, C, H_{in}, W_{in})` or :math:`(N, C, D_{in}, H_{in}, W_{in})`
      - Output: :math:`(N, C, W_{out})` or :math:`(N, C, H_{out}, W_{out})` or :math:`(N, C, D_{out}, H_{out}, W_{out})`
class_docstr_tok: ["This","layer","upsamples","a","given","input","tensor",".","Args",":","size","(","Optional","[","Union","[","int",",","Tuple","[","int",",","...","]","]",")",":","Output","spatial","size",".","Default",":","None","scale_factor","(","Optional","[","float","]",")",":","Scale","each","spatial","dimension","of","the","input","by","this","factor",".","Default",":","None","mode","(","Optional","[","str","]",")",":","Upsampling","algorithm","(","``","'nearest","'","``",",","``","'linear","'","``",",","``","'bilinear","'","``",",","``","'bicubic","'","``","and","``","'trilinear","'","``",".","Default",":","``","'nearest","'","``","align_corners","(","Optional","[","bool","]",")",":","if","``","True","``",",","the","corner","pixels","of","the","input","and","output","tensors","are","aligned",",","and","thus","preserving","the","values","at","those","pixels",".","This","only","has","effect","when",":","attr",":","`","mode","`","is","``","'linear","'","``",",","``","'bilinear","'","``",",","``","'bicubic","'","``",",","or","``","'trilinear","'","``",".","Default",":","``","None","``","Shape",":","-","Input",":",":","math",":","`","(","N",",","C",",","W_","{","in","}",")","`","or",":","math",":","`","(","N",",","C",",","H_","{","in","}",",","W_","{","in","}",")","`","or",":","math",":","`","(","N",",","C",",","D_","{","in","}",",","H_","{","in","}",",","W_","{","in","}",")","`","-","Output",":",":","math",":","`","(","N",",","C",",","W_","{","out","}",")","`","or",":","math",":","`","(","N",",","C",",","H_","{","out","}",",","W_","{","out","}",")","`","or",":","math",":","`","(","N",",","C",",","D_","{","out","}",",","H_","{","out","}",",","W_","{","out","}",")","`"]
code: def __init__(
      self,
      size: Optional[Union[int, Tuple[int, ...]]] = None,
      scale_factor: Optional[float] = None,
      mode: Optional[str] = "nearest",
      align_corners: Optional[bool] = None,
      *args,
      **kwargs,
  ) -> None:
      super().__init__(
          size=size,
          scale_factor=scale_factor,
          mode=mode,
          align_corners=align_corners,
      )
  
imports: from typing import Optional, Tuple, Union
  import torch
  from torch import Tensor, nn
label_desc: Use image node_id 1 to create a new UpSample object from inherited base classes: nn with example: obj = UpSample(size, scale_factor, mode, align_corners)