code: def build_train(x, y_):
      net = model(x, is_train=True)
      cost = tl.cost.cross_entropy(net.outputs, y_, name="cost_train")
      L2 = 0
      for p in tl.layers.get_variables_with_name("relu/W", True, True):
          L2 += tf.contrib.layers.l2_regularizer(0.004)(p)
      cost = cost + L2
      accurate_prediction = tf.equal(tf.argmax(net.outputs, 1), y_)
      accuracy = tf.reduce_mean(
          tf.cast(accurate_prediction, tf.float32),
          name="accuracy_train",
      )
      log_tensors = {"cost": cost, "accuracy": accuracy}
      return net, cost, log_tensors
  
file_path: TensorLayer/examples/distributed_training/tutorial_cifar10_distributed_trainer.py
imports: import multiprocessing
  import numpy
  import tensorflow
  import tensorlayer
  from tensorlayer.layers import BatchNormLayer, Conv2d, DenseLayer, FlattenLayer, InputLayer, MaxPool2d
label_desc: Use image node_id 5 for calling a global function with example usage: build_train(x, y_) and returns: net,  cost,  log_tensors