code: def primary(x, filters, length, kernel_size, stride, scope=None):
      x = conv(
          x, filters * length, kernel_size, stride=stride, scope="conv"
      )
      pixels = np.prod(x.shape[1:-1].as_list())
      x = reshape(x, (-1, pixels * filters, length), name="out")
      return x
  
file_path: tensornets/tensornets/capsulenets.py
imports: from __future__ import absolute_import
  import numpy
  import tensorflow
  from .layers import batch_norm
  from .layers import conv2d
  from .layers import convrelu
  from .ops import *
  from .utils import ops_to_outputs
  from .utils import set_args
  from .utils import var_scope
label_desc: Use image node_id 3 for calling a global function with example usage: primary(x, filters, length, kernel_size, stride, scope) and returns: x