code: def define_vgg16(tf_input, weights, prefix="vgg_"):
      """
      This function defines the vgg16 network using the tensorflow nn api.
  
      Parameters
      ----------
      tf_input: tensorflow.Tensor
          The input tensor to the network. The image is expected to be in RGB
          format
      weights: dictionary
          The dictionary of weights to the network. The naming convention
          used is that from the CoreML export of the Style Transfer Network.
  
      prefix: string
          The prefix column is used to prefix the variables of the network for
          weight export.
  
      Returns
      -------
  
      The function returns four tensorflow.Tensor objects used in the
      featurization of the image passed into the network.
      relu_2:  tensorflow.Tensor
          `relu` from the first block of `conv` and `relu`
  
      relu_4:  tensorflow.Tensor
          `relu` from the second block of `conv` and `relu`
  
      relu_7:  tensorflow.Tensor
          `relu` from the third block of `conv` and `relu`
      relu_10: tensorflow.Tensor
          `relu` from the fourth block of `conv` and `relu`
  
      """
      _tf = _lazy_import_tensorflow()
  
      # block 1
      conv_1_filter = weights[prefix + "block_1_conv_1_weight"]
      conv_1 = _tf.nn.conv2d(
          tf_input, conv_1_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_1_bias = weights[prefix + "block_1_conv_1_bias"]
      conv_1 = _tf.nn.bias_add(conv_1, conv_1_bias)
      relu_1 = _tf.nn.relu(conv_1)
  
      conv_2_filter = weights[prefix + "block_1_conv_2_weight"]
      conv_2 = _tf.nn.conv2d(
          relu_1, conv_2_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_2_bias = weights[prefix + "block_1_conv_2_bias"]
      conv_2 = _tf.nn.bias_add(conv_2, conv_2_bias)
      relu_2 = _tf.nn.relu(conv_2)
  
      pool_1 = _tf.nn.avg_pool(relu_2, 2, 2, "SAME")
  
      # block 2
      conv_3_filter = weights[prefix + "block_2_conv_1_weight"]
      conv_3 = _tf.nn.conv2d(
          pool_1, conv_3_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_3_bias = weights[prefix + "block_2_conv_1_bias"]
      conv_3 = _tf.nn.bias_add(conv_3, conv_3_bias)
      relu_3 = _tf.nn.relu(conv_3)
  
      conv_4_filter = weights[prefix + "block_2_conv_2_weight"]
      conv_4 = _tf.nn.conv2d(
          relu_3, conv_4_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_4_bias = weights[prefix + "block_2_conv_2_bias"]
      conv_4 = _tf.nn.bias_add(conv_4, conv_4_bias)
      relu_4 = _tf.nn.relu(conv_4)
  
      pool_2 = _tf.nn.avg_pool(relu_4, 2, 2, "SAME")
  
      # block 3
      conv_5_filter = weights[prefix + "block_3_conv_1_weight"]
      conv_5 = _tf.nn.conv2d(
          pool_2, conv_5_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_5_bias = weights[prefix + "block_3_conv_1_bias"]
      conv_5 = _tf.nn.bias_add(conv_5, conv_5_bias)
      relu_5 = _tf.nn.relu(conv_5)
  
      conv_6_filter = weights[prefix + "block_3_conv_2_weight"]
      conv_6 = _tf.nn.conv2d(
          relu_5, conv_6_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_6_bias = weights[prefix + "block_3_conv_2_bias"]
      conv_6 = _tf.nn.bias_add(conv_6, conv_6_bias)
      relu_6 = _tf.nn.relu(conv_6)
  
      conv_7_filter = weights[prefix + "block_3_conv_3_weight"]
      conv_7 = _tf.nn.conv2d(
          relu_6, conv_7_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_7_bias = weights[prefix + "block_3_conv_3_bias"]
      conv_7 = _tf.nn.bias_add(conv_7, conv_7_bias)
      relu_7 = _tf.nn.relu(conv_7)
  
      pool_3 = _tf.nn.avg_pool(relu_7, 2, 2, "SAME")
  
      # block 4
      conv_8_filter = weights[prefix + "block_4_conv_1_weight"]
      conv_8 = _tf.nn.conv2d(
          pool_3, conv_8_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_8_bias = weights[prefix + "block_4_conv_1_bias"]
      conv_8 = _tf.nn.bias_add(conv_8, conv_8_bias)
      relu_8 = _tf.nn.relu(conv_8)
  
      conv_9_filter = weights[prefix + "block_4_conv_2_weight"]
      conv_9 = _tf.nn.conv2d(
          relu_8, conv_9_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_9_bias = weights[prefix + "block_4_conv_2_bias"]
      conv_9 = _tf.nn.bias_add(conv_9, conv_9_bias)
      relu_9 = _tf.nn.relu(conv_9)
  
      conv_10_filter = weights[prefix + "block_4_conv_3_weight"]
      conv_10 = _tf.nn.conv2d(
          relu_9, conv_10_filter, strides=[1, 1, 1, 1], padding="SAME"
      )
      conv_10_bias = weights[prefix + "block_4_conv_3_bias"]
      conv_10 = _tf.nn.bias_add(conv_10, conv_10_bias)
      relu_10 = _tf.nn.relu(conv_10)
  
      return relu_2, relu_4, relu_7, relu_10
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from turicreate.toolkits._tf_model import TensorFlowModel
  import numpy
  import turicreate.toolkits._tf_utils
  from turicreate._deps.minimal_package import _minimal_package_import_check
label_desc: Use image node_id 6 for calling a global function with example usage: define_vgg16(tf_input, weights, prefix) and returns: relu_2,  relu_4,  relu_7,  relu_10