class_docstr: Optimized Densenet-BC model
class_docstr_tok: ["Optimized","Densenet-BC","model"]
code: def forward(self, x, chunks=None):
      modules = [module for k, module in self._modules.items()][0]
      input_var = x.detach()
      input_var.requires_grad = True
      input_var = checkpoint_sequential(modules, chunks, input_var)
      input_var = F.relu(input_var, inplace=True)
      input_var = F.avg_pool2d(input_var, kernel_size=7, stride=1).view(
          input_var.size(0), -1
      )
      input_var = self.classifier(input_var)
      return input_var
  
imports: from collections import OrderedDict
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.checkpoint import checkpoint_sequential
label_desc: Use image node_id 2 for calling the OptDenseNet obj's underlying member method code with example usage: obj.forward(x, chunks) and returns: input_var