parameters: (feat, projector, mask=None)
docstring: Universal projector and masking
docstring_summary: Universal projector and masking
docstring_tokens: Universal projector and masking
function: def proj_masking(feat, projector, mask=None):
      """Universal projector and masking"""
      proj_feat = projector(feat.view(-1, feat.size(2)))
      proj_feat = proj_feat.view(feat.size(0), feat.size(1), -1)
      if mask is not None:
          return proj_feat * mask.unsqueeze(2).expand_as(proj_feat)
      else:
          return proj_feat
function_tokens: def proj_masking ( feat , projector , mask = None ) : proj_feat = projector ( feat . view ( - 1 , feat . size ( 2 ) ) ) proj_feat = proj_feat . view ( feat . size ( 0 ) , feat . size ( 1 ) , - 1 ) if mask is not None : return proj_feat * mask . unsqueeze ( 2 ) . expand_as ( proj_feat ) else : return proj_feat