class_docstr: Vision Transformer with support for patch or hybrid CNN input stage
      
class_docstr_tok: ["Vision","Transformer","with","support","for","patch","or","hybrid","CNN","input","stage"]
code: def forward_head(self, x, pre_logits: bool = False):
      if self.global_pool:
          x = (
              x[:, self.num_prefix_tokens :].mean(dim=1)
              if self.global_pool == "avg"
              else x[:, 0]
          )
      x = self.fc_norm(x)
      x = self.head_drop(x)
      return x if pre_logits else self.head(x)
  
imports: import math
  from typing import Callable, Optional, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.checkpoint import checkpoint
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import PatchEmbed, Mlp, SwiGLU, LayerNorm, DropPath, trunc_normal_, use_fused_attn
  from timm.layers import resample_patch_embed, resample_abs_pos_embed, resize_rel_pos_bias_table
  from ._builder import build_model_with_cfg
  from ._registry import generate_default_cfgs, register_model
  from .vision_transformer import checkpoint_filter_fn
label_desc: Use image node_id 10 for calling the Beit obj's underlying member method code with example usage: obj.forward_head(x, pre_logits) and returns: unknown