class_docstr: A 1D upsampling layer with an optional convolution.
  
  Parameters:
      channels (`int`):
          number of channels in the inputs and outputs.
      use_conv (`bool`, default `False`):
          option to use a convolution.
      use_conv_transpose (`bool`, default `False`):
          option to use a convolution transpose.
      out_channels (`int`, optional):
          number of output channels. Defaults to `channels`.
      name (`str`, default `conv`):
          name of the upsampling 1D layer.
class_docstr_tok: ["A","1D","upsampling","layer","with","an","optional","convolution",".","Parameters",":","channels","(","`","int","`",")",":","number","of","channels","in","the","inputs","and","outputs",".","use_conv","(","`","bool","`",",","default","`","False","`",")",":","option","to","use","a","convolution",".","use_conv_transpose","(","`","bool","`",",","default","`","False","`",")",":","option","to","use","a","convolution","transpose",".","out_channels","(","`","int","`",",","optional",")",":","number","of","output","channels",".","Defaults","to","`","channels","`",".","name","(","`","str","`",",","default","`","conv","`",")",":","name","of","the","upsampling","1D","layer","."]
code: def forward(self, inputs: torch.Tensor) -> torch.Tensor:
      assert inputs.shape[1] == self.channels
      if self.use_conv_transpose:
          return self.conv(inputs)
  
      outputs = F.interpolate(inputs, scale_factor=2.0, mode="nearest")
  
      if self.use_conv:
          outputs = self.conv(outputs)
  
      return outputs
  
imports: from typing import Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from ..utils import USE_PEFT_BACKEND
  from .lora import LoRACompatibleConv
  from .normalization import RMSNorm
label_desc: Use image node_id 2 for calling the Upsample1D obj's underlying member method code with example usage: obj.forward(inputs) and returns: outputs, self