class_docstr: Upsample module.
  
  Args:
      scale (int): Scale factor. Supported scales: 2^n and 3.
      num_feat (int): Channel number of intermediate features.
class_docstr_tok: ["Upsample","module",".","Args",":","scale","(","int",")",":","Scale","factor",".","Supported","scales",":","2^n","and","3.","num_feat","(","int",")",":","Channel","number","of","intermediate","features","."]
code: def __init__(self, scale, num_feat):
      m = []
      if (scale & (scale - 1)) == 0:  # scale = 2^n
          for _ in range(int(math.log(scale, 2))):
              m.append(nn.Conv2d(num_feat, 4 * num_feat, 3, 1, 1))
              m.append(nn.PixelShuffle(2))
      elif scale == 3:
          m.append(nn.Conv2d(num_feat, 9 * num_feat, 3, 1, 1))
          m.append(nn.PixelShuffle(3))
      else:
          raise ValueError(
              f"scale {scale} is not supported. "
              "Supported scales: 2^n and 3."
          )
      super(Upsample, self).__init__(*m)
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.checkpoint
  from timm.models.layers import DropPath, to_2tuple, trunc_normal_
label_desc: Use image node_id 1 to create a new Upsample object from inherited base classes: nn with example: obj = Upsample(scale, num_feat)