code: def densenet(
      x, blocks, is_training, classes, stem, scope=None, reuse=None
  ):
      x = pad(x, pad_info(7), name="conv1/pad")
      x = conv(x, 64, 7, stride=2, scope="conv1")
      x = pad(x, pad_info(3), name="pool1/pad")
      x = max_pool2d(x, 3, stride=2, scope="pool1")
  
      x = dense(x, blocks[0], scope="conv2")
      x = transition(x, scope="pool2")
      x = dense(x, blocks[1], scope="conv3")
      x = transition(x, scope="pool3")
      x = dense(x, blocks[2], scope="conv4")
      x = transition(x, scope="pool4")
      x = dense(x, blocks[3], scope="conv5")
  
      x = batch_norm(x)
      x = relu(x)
      if stem:
          return x
  
      x = reduce_mean(x, [1, 2], name="avgpool")
      x = fc(x, classes, scope="logits")
      x = softmax(x, name="probs")
      return x
  
file_path: tensornets/tensornets/densenets.py
imports: from __future__ import absolute_import
  import tensorflow
  from .layers import avg_pool2d
  from .layers import batch_norm
  from .layers import conv2d
  from .layers import fc
  from .layers import max_pool2d
  from .layers import convbnrelu
  from .ops import *
  from .utils import pad_info
  from .utils import set_args
  from .utils import var_scope
label_desc: Use image node_id 2 for calling a global function with example usage: densenet(x, blocks, is_training, classes, stem, scope, reuse) and returns: x, x