class_docstr: A UNetModel that conditions on text with a pretrained text encoder in CLIP.
  
  :param text_ctx: number of text tokens to expect.
  :param xf_width: width of the transformer.
  :param clip_emb_mult: #extra tokens by projecting clip text feature.
  :param clip_emb_type: type of condition (here, we fix clip image feature).
  :param clip_emb_drop: dropout rato of clip image feature for cfg.
class_docstr_tok: ["A","UNetModel","that","conditions","on","text","with","a","pretrained","text","encoder","in","CLIP",".",":","param","text_ctx",":","number","of","text","tokens","to","expect",".",":","param","xf_width",":","width","of","the","transformer",".",":","param","clip_emb_mult",":","#","extra","tokens","by","projecting","clip","text","feature",".",":","param","clip_emb_type",":","type","of","condition","(","here",",","we","fix","clip","image","feature",")",".",":","param","clip_emb_drop",":","dropout","rato","of","clip","image","feature","for","cfg","."]
code: def __init__(
      self,
      text_ctx,
      xf_width,
      *args,
      clip_emb_mult=None,
      clip_emb_type="image",
      clip_emb_drop=0.0,
      **kwargs,
  ):
      self.text_ctx = text_ctx
      self.xf_width = xf_width
      self.clip_emb_mult = clip_emb_mult
      self.clip_emb_type = clip_emb_type
      self.clip_emb_drop = clip_emb_drop
  
      if not xf_width:
          super().__init__(*args, **kwargs, encoder_channels=None)
      else:
          super().__init__(*args, **kwargs, encoder_channels=xf_width)
  
      # Project text encoded feat seq from pre-trained text encoder in CLIP
      self.text_seq_proj = nn.Sequential(
          nn.Linear(self.clip_dim, xf_width),
          LayerNorm(xf_width),
      )
      # Project CLIP text feat
      self.text_feat_proj = nn.Linear(
          self.clip_dim, self.model_channels * 4
      )
  
      assert clip_emb_mult is not None
      assert clip_emb_type == "image"
      assert (
          self.clip_dim is not None
      ), "CLIP representation dim should be specified"
  
      self.clip_tok_proj = nn.Linear(
          self.clip_dim, self.xf_width * self.clip_emb_mult
      )
      if self.clip_emb_drop > 0:
          self.cf_param = nn.Parameter(
              th.empty(self.clip_dim, dtype=th.float32)
          )
  
imports: import math
  from abc import abstractmethod
  import torch
  import torch.nn
  import torch.nn.functional
  from .nn import avg_pool_nd, conv_nd, linear, normalization, timestep_embedding, zero_module
  from .xf import LayerNorm
label_desc: Use image node_id 1 to create a new PLMImUNet object from inherited base classes: UNetModel with example: obj = PLMImUNet(text_ctx, xf_width)