code: def modify_alexnet(model):
      # Modify attributs
      model._features = model.features
      del model.features
      model.dropout0 = model.classifier[0]
      model.linear0 = model.classifier[1]
      model.relu0 = model.classifier[2]
      model.dropout1 = model.classifier[3]
      model.linear1 = model.classifier[4]
      model.relu1 = model.classifier[5]
      model.last_linear = model.classifier[6]
      del model.classifier
  
      def features(self, input):
          x = self._features(input)
          x = x.view(x.size(0), 256 * 6 * 6)
          x = self.dropout0(x)
          x = self.linear0(x)
          x = self.relu0(x)
          x = self.dropout1(x)
          x = self.linear1(x)
          return x
  
      def logits(self, features):
          x = self.relu1(features)
          x = self.last_linear(x)
          return x
  
      def forward(self, input):
          x = self.features(input)
          x = self.logits(x)
          return x
  
      # Modify methods
      model.features = types.MethodType(features, model)
      model.logits = types.MethodType(logits, model)
      model.forward = types.MethodType(forward, model)
      return model
  
imports: from __future__ import print_function, division, absolute_import
  import torchvision.models
  import torch.utils.model_zoo
  import torch.nn.functional
  import types
  import re
label_desc: Use image node_id 3 for calling a global function with example usage: modify_alexnet(model) and returns: model, x, x, x