code: def encode_with_transformers(self, tokens):
      outputs = self.wrapped.transformer(
          input_ids=tokens,
          output_hidden_states=-opts.CLIP_stop_at_last_layers,
      )
  
      if opts.CLIP_stop_at_last_layers > 1:
          z = outputs.hidden_states[-opts.CLIP_stop_at_last_layers]
          z = self.wrapped.transformer.text_model.final_layer_norm(z)
      else:
          z = outputs.last_hidden_state
  
      return z
  
imports: import math
  from collections import namedtuple
  import torch
  from modules import prompt_parser, devices, sd_hijack
  from modules.shared import opts
label_desc: Use image node_id 3 for calling the FrozenCLIPEmbedderWithCustomWords obj's underlying member method code with example usage: obj.encode_with_transformers(tokens) and returns: z