code: def make_non_local(net, n_segment):
      if isinstance(net, torchvision.models.ResNet):
          net.layer2 = nn.Sequential(
              NL3DWrapper(net.layer2[0], n_segment),
              net.layer2[1],
              NL3DWrapper(net.layer2[2], n_segment),
              net.layer2[3],
          )
          net.layer3 = nn.Sequential(
              NL3DWrapper(net.layer3[0], n_segment),
              net.layer3[1],
              NL3DWrapper(net.layer3[2], n_segment),
              net.layer3[3],
              NL3DWrapper(net.layer3[4], n_segment),
              net.layer3[5],
          )
      else:
          raise NotImplementedError
  
imports: import torch
  from torch import nn
  from torch.nn import functional
  import torchvision
label_desc: Use image node_id 1 for calling a global function with example usage: make_non_local(net, n_segment) without return types