class_docstr: Container for ResNet50 s.t. it can be used for metric learning.
  The Network has been broken down to allow for higher modularity, if one wishes
  to target specific layers/blocks directly.
class_docstr_tok: ["Container","for","ResNet50","s.t",".","it","can","be","used","for","metric","learning",".","The","Network","has","been","broken","down","to","allow","for","higher","modularity",",","if","one","wishes","to","target","specific","layers\/blocks","directly","."]
code: def forward(self, x, feature=False, is_init_cluster_generation=False):
      x = self.model.maxpool(
          self.model.relu(self.model.bn1(self.model.conv1(x)))
      )
  
      for layerblock in self.layer_blocks:
          x = layerblock(x)
  
      x = self.model.avgpool(x)
      x = x.view(x.size(0), -1)
  
      if self.pars.embed_dim != 2048:
          mod_x = self.model.last_linear(x)
      else:
          mod_x = x
  
      feat = torch.nn.functional.normalize(mod_x, dim=-1)
  
      if feature or self.loss == "smoothap":
          return feat
      else:
          pred = self.linear(feat)
          return pred
  
file_path: dgl/examples/pytorch/hilander/PSS/Smooth_AP/src/netlib.py
imports: import os
  from collections import OrderedDict
  import auxiliaries
  import pretrainedmodels
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the ResNet50 obj's underlying member method code with example usage: obj.forward(x, feature, is_init_cluster_generation) and returns: feat, pred