class_docstr: Multiscale Vision Transformers
  Haoqi Fan, Bo Xiong, Karttikeya Mangalam, Yanghao Li, Zhicheng Yan, Jitendra Malik,
  Christoph Feichtenhofer
  https://arxiv.org/abs/2104.11227
  
  ::
  
                                     PatchEmbed
                                         ↓
                                 PositionalEncoding
                                         ↓
                                      Dropout
                                         ↓
                                   Normalization
                                         ↓
                                       Block 1
                                         ↓
                                         .
                                         .
                                         .
                                         ↓
                                       Block N
                                         ↓
                                   Normalization
                                         ↓
                                        Head
  
  
  The builder can be found in `create_mvit`.
class_docstr_tok: ["Multiscale","Vision","Transformers","Haoqi","Fan",",","Bo","Xiong",",","Karttikeya","Mangalam",",","Yanghao","Li",",","Zhicheng","Yan",",","Jitendra","Malik",",","Christoph","Feichtenhofer","https",":","\/\/arxiv.org\/abs\/2104.11227",":",":","PatchEmbed","\u2193","PositionalEncoding","\u2193","Dropout","\u2193","Normalization","\u2193","Block","1","\u2193",".",".",".","\u2193","Block","N","\u2193","Normalization","\u2193","Head","The","builder","can","be","found","in","`","create_mvit","`","."]
code: def fuse_norm_before_linear(self, bn, linear):
      if bn is None:
          return linear
      w_bn, b_bn = self._get_bn_w_b(bn)
      fused_linear = nn.Linear(
          linear.in_features, linear.out_features, bias=True
      )
      fused_linear.weight.data[:] = torch.mm(linear.weight, w_bn)
      fused_linear.bias.data[:] = (
          torch.matmul(linear.weight, b_bn) + linear.bias
          if linear.bias is not None
          else torch.matmul(linear.weight, b_bn)
      )
      return fused_linear
  
file_path: pytorchvideo/pytorchvideo/models/vision_transformers.py
imports: import warnings
  from functools import partial
  from typing import Callable, List, Optional, Tuple
  import torch
  import torch.nn
  from pytorchvideo.layers import MultiScaleBlock, SpatioTemporalClsPositionalEncoding
  from pytorchvideo.layers.utils import round_width, set_attributes
  from pytorchvideo.models.head import create_vit_basic_head
  from pytorchvideo.models.weight_init import init_net_weights
  from torch.nn.common_types import _size_2_t, _size_3_t
  from .stem import create_conv_patch_embed
label_desc: Use image node_id 3 for calling the MultiscaleVisionTransformers obj's underlying member method code with example usage: obj.fuse_norm_before_linear(bn, linear) and returns: fused_linear, linear