code: def _rename_basic_resnet_weights(layer_keys):
      layer_keys = [k.replace("_", ".") for k in layer_keys]
      layer_keys = [k.replace(".w", ".weight") for k in layer_keys]
      layer_keys = [k.replace(".bn", "_bn") for k in layer_keys]
      layer_keys = [k.replace(".b", ".bias") for k in layer_keys]
      layer_keys = [k.replace("_bn.s", "_bn.scale") for k in layer_keys]
      layer_keys = [
          k.replace(".biasranch", ".branch") for k in layer_keys
      ]
      layer_keys = [
          k.replace("res.conv1_", "conv1_") for k in layer_keys
      ]
  
      # Affine-Channel -> BatchNorm enaming
      layer_keys = [
          k.replace("_bn.scale", "_bn.weight") for k in layer_keys
      ]
      layer_keys = [
          k.replace("_bn.rm", "_bn.running_mean") for k in layer_keys
      ]
      layer_keys = [
          k.replace("_bn.riv", "_bn.running_var") for k in layer_keys
      ]
  
      # Make torchvision-compatible
      layer_keys = [k.replace("conv1_bn.", "bn1.") for k in layer_keys]
  
      layer_keys = [k.replace("res2.", "layer1.") for k in layer_keys]
      layer_keys = [k.replace("res3.", "layer2.") for k in layer_keys]
      layer_keys = [k.replace("res4.", "layer3.") for k in layer_keys]
      layer_keys = [k.replace("res5.", "layer4.") for k in layer_keys]
  
      layer_keys = [
          k.replace(".branch2a.", ".conv1.") for k in layer_keys
      ]
      layer_keys = [
          k.replace(".branch2a_bn.", ".bn1.") for k in layer_keys
      ]
      layer_keys = [
          k.replace(".branch2b.", ".conv2.") for k in layer_keys
      ]
      layer_keys = [
          k.replace(".branch2b_bn.", ".bn2.") for k in layer_keys
      ]
      layer_keys = [
          k.replace(".branch2c.", ".conv3.") for k in layer_keys
      ]
      layer_keys = [
          k.replace(".branch2c_bn.", ".bn3.") for k in layer_keys
      ]
  
      layer_keys = [
          k.replace(".branch1.", ".downsample.0.") for k in layer_keys
      ]
      layer_keys = [
          k.replace(".branch1_bn.", ".downsample.1.")
          for k in layer_keys
      ]
  
      return layer_keys
  
file_path: vissl/extra_scripts/convert_caffe2_to_torchvision_resnet.py
imports: import argparse
  import logging
  import pickle
  import re
  import sys
  from collections import OrderedDict
  import torch
  from iopath.common.file_io import g_pathmgr
label_desc: Use image node_id 2 for calling a global function with example usage: _rename_basic_resnet_weights(layer_keys) and returns: layer_keys