code: def reduce_sum(x: tf.Tensor, axis=None, keepdims=False):
      if axis is None:
          axis = [i for i in range(len(x.shape) - 1)]
      if not isinstance(axis, list):
          axis = [axis]
      assert __is_tf_tensor(x)
      assert all(a < len(x.shape) - 1 for a in axis)
      assert x.shape[-1] == 2
      axis = sorted(axis)
  
      def shape_after_reduce(shape, axis, keepdims):
          index_axis = 0
          new_shape = []
          for index, s in enumerate(shape):
              if index == axis[index_axis]:
                  if keepdims:
                      new_shape.append(1)
                  if index_axis + 1 < len(axis):
                      index_axis += 1
              else:
                  new_shape.append(s)
          return new_shape
  
      t = tf_i128.i128_reduce_sum(x, axis=axis, keepdims=bool(keepdims))
      reduced_shape = shape_after_reduce(
          x.shape.as_list()[:-1], axis, bool(keepdims)
      )
      reduced_shape.append(2)
      t.set_shape(reduced_shape)
      return t
  
imports: import logging
  import os
  import numpy
  import tensorflow
  from tensorflow.python.framework.errors import NotFoundError
  import tf_encrypted
label_desc: Use image node_id 7 for calling a global function with example usage: reduce_sum(x, axis, keepdims) and returns: t, new_shape