class_docstr: Text extractor
  Args:
      common_space_dim (int): common space dimension
      num_text_transformer_layers (int): number of text transformer layers
      img_feat_dim (int): image feature dimension
      txt_feat_dim (int): text feature dimension
      image_disabled (bool): image disabled
      aggregate_tokens_depth (int): aggregate tokens depth
      fusion_mode (str): feature fusion mode
class_docstr_tok: ["Text","extractor","Args",":","common_space_dim","(","int",")",":","common","space","dimension","num_text_transformer_layers","(","int",")",":","number","of","text","transformer","layers","img_feat_dim","(","int",")",":","image","feature","dimension","txt_feat_dim","(","int",")",":","text","feature","dimension","image_disabled","(","bool",")",":","image","disabled","aggregate_tokens_depth","(","int",")",":","aggregate","tokens","depth","fusion_mode","(","str",")",":","feature","fusion","mode"]
code: def compute_embeddings(
      self, img, url, url_mask, caption, caption_mask
  ):
      alphas = None
      if torch.cuda.is_available():
          img = img.cuda() if img is not None else None
          url = url.cuda()
          url_mask = url_mask.cuda()
          caption = caption.cuda()
          caption_mask = caption_mask.cuda()
  
      url_feats = self.txt_model(url, url_mask)
      url_feats_plus = self.url_process(
          url_feats[-1], url_mask
      )  # process features from the last layer
      if self.aggregate_tokens_depth:
          url_feats_depth_aggregated = self.token_aggregator(
              url_feats, url_mask
          )
          url_feats = url_feats_plus + url_feats_depth_aggregated
      else:
          url_feats = url_feats_plus
  
      caption_feats = self.txt_model(caption, caption_mask)
      caption_feats_plus = self.caption_process(
          caption_feats[-1], caption_mask
      )
      if self.aggregate_tokens_depth:
          caption_feats_depth_aggregated = self.token_aggregator(
              caption_feats, caption_mask
          )
          caption_feats = (
              caption_feats_plus + caption_feats_depth_aggregated
          )  # same as for urls
      else:
          caption_feats = caption_feats_plus
  
      if not self.image_disabled:
          # forward img model
          img_feats = self.img_model(img).float()
          img_feats = self.image_fc(img_feats)
          # concatenate img and url features
          if self.fusion_mode == "concat":
              query_feats = torch.cat([img_feats, url_feats], dim=1)
              query_feats = self.process_after_concat(query_feats)
          else:
              query_feats, alphas = self.process_after_concat(
                  img_feats, url_feats
              )
      else:
          query_feats = url_feats
  
      # L2 normalize output features
      query_feats = F.normalize(query_feats, p=2, dim=1)
      caption_feats = F.normalize(caption_feats, p=2, dim=1)
  
      return query_feats, caption_feats, alphas
  
file_path: towhee/towhee/models/mcprop/matching.py
imports: import torch
  from torch import nn
  from torch.nn import functional
  from towhee.models.mcprop.loss import ContrastiveLoss
  from towhee.models.mcprop.imageextractor import ImageExtractor
  from towhee.models.mcprop.textextractor import TextExtractor
  from towhee.models.mcprop.featurefusion import FeatureFusion
  from towhee.models.mcprop.transformerpooling import TransformerPooling
  from towhee.models.mcprop.depthaggregator import DepthAggregator
label_desc: Use image node_id 2 for calling the Matching obj's underlying member method code with example usage: obj.compute_embeddings(img, url, url_mask, caption, caption_mask) and returns: query_feats,  caption_feats,  alphas