code: def encode_with_transformers(self, tokens):
      outputs = self.wrapped.transformer(
          input_ids=tokens,
          output_hidden_states=self.wrapped.layer == "hidden",
      )
  
      if self.wrapped.layer == "last":
          z = outputs.last_hidden_state
      else:
          z = outputs.hidden_states[self.wrapped.layer_idx]
  
      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 2 for calling the FrozenCLIPEmbedderForSDXLWithCustomWords obj's underlying member method code with example usage: obj.encode_with_transformers(tokens) and returns: z