class_docstr: Uses the OpenCLIP transformer encoder for text
class_docstr_tok: ["Uses","the","OpenCLIP","transformer","encoder","for","text"]
code: def text_transformer_forward(self, x: torch.Tensor, attn_mask=None):
      for i, r in enumerate(self.model.transformer.resblocks):
          if (
              i
              == len(self.model.transformer.resblocks) - self.layer_idx
          ):
              break
          if (
              self.model.transformer.grad_checkpointing
              and not torch.jit.is_scripting()
          ):
              x = checkpoint(r, x, attn_mask)
          else:
              x = r(x, attn_mask=attn_mask)
      return x
  
imports: import torch
  import torch.nn
  import kornia
  from torch.utils.checkpoint import checkpoint
  from transformers import T5Tokenizer, T5EncoderModel, CLIPTokenizer, CLIPTextModel
  import open_clip
  from ldm.util import default, count_params, autocast
  from ldm.modules.diffusionmodules.upscaling import ImageConcatWithNoiseAugmentation
  from ldm.modules.diffusionmodules.openaimodel import Timestep
label_desc: Use image node_id 5 for calling the FrozenOpenCLIPEmbedder obj's underlying member method code with example usage: obj.text_transformer_forward(x, attn_mask) and returns: x