class_docstr: Upsampling based on ConvTranspose2d. This is needed for bfloat support.
  
  :param channels: channels in the inputs and outputs.
  :param use_conv: a bool determining if a convolution is applied.
  :param dims: determines if the signal is 1D, 2D, or 3D. If 3D, then
               upsampling occurs in the inner-two dimensions.
class_docstr_tok: ["Upsampling","based","on","ConvTranspose2d",".","This","is","needed","for","bfloat","support",".",":","param","channels",":","channels","in","the","inputs","and","outputs",".",":","param","use_conv",":","a","bool","determining","if","a","convolution","is","applied",".",":","param","dims",":","determines","if","the","signal","is","1D",",","2D",",","or","3D",".","If","3D",",","then","upsampling","occurs","in","the","inner-two","dimensions","."]
code: def __init__(self, channels, use_conv, dims=2, out_channels=None):
      super().__init__()
      self.channels = channels
      self.out_channels = out_channels or channels
      self.use_conv = use_conv
      self.dims = dims
  
      if self.dims == 2:
          self.conv = nn.ConvTranspose2d(
              self.channels, self.out_channels, 4, 2, 1
          )
      elif self.dims == 3:
          self.conv = nn.ConvTranspose3d(
              self.channels,
              self.out_channels,
              kernel_size=(1, 4, 4),
              stride=(1, 2, 2),
              padding=(0, 1, 1),
          )
      else:
          raise ValueError("Upsampling support only for 2D and 3D")
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from apex.contrib.group_norm import GroupNorm
label_desc: Use image node_id 1 to create a new UpsampleLearnable object from inherited base classes: nn with example: obj = UpsampleLearnable(channels, use_conv, dims, out_channels)