code: def encode_with_transformers(self, tokens):
      # there's no CLIP Skip here because all hidden layers have size of 1024 and the last one uses a
      # trained layer to transform those 1024 into 768 for unet; so you can't choose which transformer
      # layer to work with - you have to use the last
  
      attention_mask = (tokens != self.id_pad).to(
          device=tokens.device, dtype=torch.int64
      )
      features = self.wrapped(
          input_ids=tokens, attention_mask=attention_mask
      )
      z = features["projection_state"]
  
      return z
  
imports: import torch
  from modules import sd_hijack_clip, devices
label_desc: Use image node_id 2 for calling the FrozenXLMREmbedderWithCustomWords obj's underlying member method code with example usage: obj.encode_with_transformers(tokens) and returns: z