code: def inception_v1_base(
      inputs,
      final_endpoint="Mixed_5c",
      include_root_block=True,
      scope="InceptionV1",
  ):
      """Defines the Inception V1 base architecture.
  
      This architecture is defined in:
        Going deeper with convolutions
        Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed,
        Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, Andrew Rabinovich.
        http://arxiv.org/pdf/1409.4842v1.pdf.
  
      Args:
        inputs: a tensor of size [batch_size, height, width, channels].
        final_endpoint: specifies the endpoint to construct the network up to. It
          can be one of ['Conv2d_1a_7x7', 'MaxPool_2a_3x3', 'Conv2d_2b_1x1',
          'Conv2d_2c_3x3', 'MaxPool_3a_3x3', 'Mixed_3b', 'Mixed_3c',
          'MaxPool_4a_3x3', 'Mixed_4b', 'Mixed_4c', 'Mixed_4d', 'Mixed_4e',
          'Mixed_4f', 'MaxPool_5a_2x2', 'Mixed_5b', 'Mixed_5c']. If
          include_root_block is False, ['Conv2d_1a_7x7', 'MaxPool_2a_3x3',
          'Conv2d_2b_1x1', 'Conv2d_2c_3x3', 'MaxPool_3a_3x3'] will not be available.
        include_root_block: If True, include the convolution and max-pooling layers
          before the inception modules. If False, excludes those layers.
        scope: Optional variable_scope.
  
      Returns:
        A dictionary from components of the network to the corresponding activation.
  
      Raises:
        ValueError: if final_endpoint is not set to one of the predefined values.
      """
      end_points = {}
      with tf.variable_scope(scope, "InceptionV1", [inputs]):
          with slim.arg_scope(
              [slim.conv2d, slim.fully_connected],
              weights_initializer=tf.contrib.layers.xavier_initializer(),
              biases_initializer=tf.initializers.constant(0.1),
          ):
              with slim.arg_scope(
                  [slim.conv2d, slim.max_pool2d],
                  stride=1,
                  padding="SAME",
              ):
                  net = inputs
                  if include_root_block:
                      end_point = "Conv2d_1a_7x7"
                      net = slim.conv2d(
                          inputs, 64, [7, 7], stride=2, scope=end_point
                      )
                      end_points[end_point] = net
                      if final_endpoint == end_point:
                          return net, end_points
                      end_point = "MaxPool_2a_3x3"
                      net = slim.max_pool2d(
                          net, [3, 3], stride=2, scope=end_point
                      )
                      net = tf.nn.local_response_normalization(
                          net, 5, 0.0001, 0.75
                      )
                      end_points[end_point] = net
                      if final_endpoint == end_point:
                          return net, end_points
                      end_point = "Conv2d_2b_1x1"
                      net = slim.conv2d(
                          net, 64, [1, 1], scope=end_point
                      )
                      end_points[end_point] = net
                      if final_endpoint == end_point:
                          return net, end_points
                      end_point = "Conv2d_2c_3x3"
                      net = slim.conv2d(
                          net, 192, [3, 3], scope=end_point
                      )
                      end_points[end_point] = net
                      net = tf.nn.local_response_normalization(
                          net, 5, 0.0001, 0.75
                      )
                      if final_endpoint == end_point:
                          return net, end_points
                      end_point = "MaxPool_3a_3x3"
                      net = slim.max_pool2d(
                          net, [3, 3], stride=2, scope=end_point
                      )
                      end_points[end_point] = net
                      if final_endpoint == end_point:
                          return net, end_points
  
                  end_point = "Mixed_3b"
                  with tf.variable_scope(end_point):
                      with tf.variable_scope("Branch_0"):
                          branch_0 = slim.conv2d(
                              net, 64, [1, 1], scope="Conv2d_0a_1x1"
                          )
                      with tf.variable_scope("Branch_1"):
                          branch_1 = slim.conv2d(
                              net, 96, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_1 = slim.conv2d(
                              branch_1,
                              128,
                              [3, 3],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_2"):
                          branch_2 = slim.conv2d(
                              net, 16, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_2 = slim.conv2d(
                              branch_2,
                              32,
                              [5, 5],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_3"):
                          branch_3 = slim.max_pool2d(
                              net, [3, 3], scope="MaxPool_0a_3x3"
                          )
                          branch_3 = slim.conv2d(
                              branch_3,
                              32,
                              [1, 1],
                              scope="Conv2d_0b_1x1",
                          )
                      net = tf.concat(
                          axis=3,
                          values=[
                              branch_0,
                              branch_1,
                              branch_2,
                              branch_3,
                          ],
                      )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "Mixed_3c"
                  with tf.variable_scope(end_point):
                      with tf.variable_scope("Branch_0"):
                          branch_0 = slim.conv2d(
                              net, 128, [1, 1], scope="Conv2d_0a_1x1"
                          )
                      with tf.variable_scope("Branch_1"):
                          branch_1 = slim.conv2d(
                              net, 128, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_1 = slim.conv2d(
                              branch_1,
                              192,
                              [3, 3],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_2"):
                          branch_2 = slim.conv2d(
                              net, 32, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_2 = slim.conv2d(
                              branch_2,
                              96,
                              [5, 5],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_3"):
                          branch_3 = slim.max_pool2d(
                              net, [3, 3], scope="MaxPool_0a_3x3"
                          )
                          branch_3 = slim.conv2d(
                              branch_3,
                              64,
                              [1, 1],
                              scope="Conv2d_0b_1x1",
                          )
                      net = tf.concat(
                          axis=3,
                          values=[
                              branch_0,
                              branch_1,
                              branch_2,
                              branch_3,
                          ],
                      )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "MaxPool_4a_3x3"
                  net = slim.max_pool2d(
                      net, [3, 3], stride=2, scope=end_point
                  )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "Mixed_4b"
                  with tf.variable_scope(end_point):
                      with tf.variable_scope("Branch_0"):
                          branch_0 = slim.conv2d(
                              net, 192, [1, 1], scope="Conv2d_0a_1x1"
                          )
                      with tf.variable_scope("Branch_1"):
                          branch_1 = slim.conv2d(
                              net, 96, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_1 = slim.conv2d(
                              branch_1,
                              208,
                              [3, 3],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_2"):
                          branch_2 = slim.conv2d(
                              net, 16, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_2 = slim.conv2d(
                              branch_2,
                              48,
                              [5, 5],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_3"):
                          branch_3 = slim.max_pool2d(
                              net, [3, 3], scope="MaxPool_0a_3x3"
                          )
                          branch_3 = slim.conv2d(
                              branch_3,
                              64,
                              [1, 1],
                              scope="Conv2d_0b_1x1",
                          )
                      net = tf.concat(
                          axis=3,
                          values=[
                              branch_0,
                              branch_1,
                              branch_2,
                              branch_3,
                          ],
                      )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "Mixed_4c"
                  with tf.variable_scope(end_point):
                      with tf.variable_scope("Branch_0"):
                          branch_0 = slim.conv2d(
                              net, 160, [1, 1], scope="Conv2d_0a_1x1"
                          )
                      with tf.variable_scope("Branch_1"):
                          branch_1 = slim.conv2d(
                              net, 112, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_1 = slim.conv2d(
                              branch_1,
                              224,
                              [3, 3],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_2"):
                          branch_2 = slim.conv2d(
                              net, 24, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_2 = slim.conv2d(
                              branch_2,
                              64,
                              [5, 5],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_3"):
                          branch_3 = slim.max_pool2d(
                              net, [3, 3], scope="MaxPool_0a_3x3"
                          )
                          branch_3 = slim.conv2d(
                              branch_3,
                              64,
                              [1, 1],
                              scope="Conv2d_0b_1x1",
                          )
                      net = tf.concat(
                          axis=3,
                          values=[
                              branch_0,
                              branch_1,
                              branch_2,
                              branch_3,
                          ],
                      )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "Mixed_4d"
                  with tf.variable_scope(end_point):
                      with tf.variable_scope("Branch_0"):
                          branch_0 = slim.conv2d(
                              net, 128, [1, 1], scope="Conv2d_0a_1x1"
                          )
                      with tf.variable_scope("Branch_1"):
                          branch_1 = slim.conv2d(
                              net, 128, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_1 = slim.conv2d(
                              branch_1,
                              256,
                              [3, 3],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_2"):
                          branch_2 = slim.conv2d(
                              net, 24, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_2 = slim.conv2d(
                              branch_2,
                              64,
                              [5, 5],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_3"):
                          branch_3 = slim.max_pool2d(
                              net, [3, 3], scope="MaxPool_0a_3x3"
                          )
                          branch_3 = slim.conv2d(
                              branch_3,
                              64,
                              [1, 1],
                              scope="Conv2d_0b_1x1",
                          )
                      net = tf.concat(
                          axis=3,
                          values=[
                              branch_0,
                              branch_1,
                              branch_2,
                              branch_3,
                          ],
                      )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "Mixed_4e"
                  with tf.variable_scope(end_point):
                      with tf.variable_scope("Branch_0"):
                          branch_0 = slim.conv2d(
                              net, 112, [1, 1], scope="Conv2d_0a_1x1"
                          )
                      with tf.variable_scope("Branch_1"):
                          branch_1 = slim.conv2d(
                              net, 144, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_1 = slim.conv2d(
                              branch_1,
                              288,
                              [3, 3],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_2"):
                          branch_2 = slim.conv2d(
                              net, 32, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_2 = slim.conv2d(
                              branch_2,
                              64,
                              [5, 5],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_3"):
                          branch_3 = slim.max_pool2d(
                              net, [3, 3], scope="MaxPool_0a_3x3"
                          )
                          branch_3 = slim.conv2d(
                              branch_3,
                              64,
                              [1, 1],
                              scope="Conv2d_0b_1x1",
                          )
                      net = tf.concat(
                          axis=3,
                          values=[
                              branch_0,
                              branch_1,
                              branch_2,
                              branch_3,
                          ],
                      )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "Mixed_4f"
                  with tf.variable_scope(end_point):
                      with tf.variable_scope("Branch_0"):
                          branch_0 = slim.conv2d(
                              net, 256, [1, 1], scope="Conv2d_0a_1x1"
                          )
                      with tf.variable_scope("Branch_1"):
                          branch_1 = slim.conv2d(
                              net, 160, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_1 = slim.conv2d(
                              branch_1,
                              320,
                              [3, 3],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_2"):
                          branch_2 = slim.conv2d(
                              net, 32, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_2 = slim.conv2d(
                              branch_2,
                              128,
                              [5, 5],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_3"):
                          branch_3 = slim.max_pool2d(
                              net, [3, 3], scope="MaxPool_0a_3x3"
                          )
                          branch_3 = slim.conv2d(
                              branch_3,
                              128,
                              [1, 1],
                              scope="Conv2d_0b_1x1",
                          )
                      net = tf.concat(
                          axis=3,
                          values=[
                              branch_0,
                              branch_1,
                              branch_2,
                              branch_3,
                          ],
                      )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "MaxPool_5a_2x2"
                  net = slim.max_pool2d(
                      net, [3, 3], stride=2, scope=end_point
                  )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "Mixed_5b"
                  with tf.variable_scope(end_point):
                      with tf.variable_scope("Branch_0"):
                          branch_0 = slim.conv2d(
                              net, 256, [1, 1], scope="Conv2d_0a_1x1"
                          )
                      with tf.variable_scope("Branch_1"):
                          branch_1 = slim.conv2d(
                              net, 160, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_1 = slim.conv2d(
                              branch_1,
                              320,
                              [3, 3],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_2"):
                          branch_2 = slim.conv2d(
                              net, 32, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_2 = slim.conv2d(
                              branch_2,
                              128,
                              [5, 5],
                              scope="Conv2d_0a_3x3",
                          )
                      with tf.variable_scope("Branch_3"):
                          branch_3 = slim.max_pool2d(
                              net, [3, 3], scope="MaxPool_0a_3x3"
                          )
                          branch_3 = slim.conv2d(
                              branch_3,
                              128,
                              [1, 1],
                              scope="Conv2d_0b_1x1",
                          )
                      net = tf.concat(
                          axis=3,
                          values=[
                              branch_0,
                              branch_1,
                              branch_2,
                              branch_3,
                          ],
                      )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
  
                  end_point = "Mixed_5c"
                  with tf.variable_scope(end_point):
                      with tf.variable_scope("Branch_0"):
                          branch_0 = slim.conv2d(
                              net, 384, [1, 1], scope="Conv2d_0a_1x1"
                          )
                      with tf.variable_scope("Branch_1"):
                          branch_1 = slim.conv2d(
                              net, 192, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_1 = slim.conv2d(
                              branch_1,
                              384,
                              [3, 3],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_2"):
                          branch_2 = slim.conv2d(
                              net, 48, [1, 1], scope="Conv2d_0a_1x1"
                          )
                          branch_2 = slim.conv2d(
                              branch_2,
                              128,
                              [5, 5],
                              scope="Conv2d_0b_3x3",
                          )
                      with tf.variable_scope("Branch_3"):
                          branch_3 = slim.max_pool2d(
                              net, [3, 3], scope="MaxPool_0a_3x3"
                          )
                          branch_3 = slim.conv2d(
                              branch_3,
                              128,
                              [1, 1],
                              scope="Conv2d_0b_1x1",
                          )
                      net = tf.concat(
                          axis=3,
                          values=[
                              branch_0,
                              branch_1,
                              branch_2,
                              branch_3,
                          ],
                      )
                  end_points[end_point] = net
                  if final_endpoint == end_point:
                      return net, end_points
          invalidInputError(
              False, "Unknown final endpoint %s" % final_endpoint
          )
  
file_path: BigDL/python/orca/example/learn/tf/inception/nets/inception_v1.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from nets import inception_utils
  from bigdl.dllib.utils.log4Error import invalidInputError
label_desc: Use image node_id 1 for calling a global function with example usage: inception_v1_base(inputs, final_endpoint, include_root_block, scope) and returns: net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points, net,  end_points