code: def sum(x, axis=None, keepdims=True):
      if (
          isfloat_tensor(x)
          and isccontiguous(x)
          and istensor2d(x)
          and x.size > omp_threshold
          and axis is not None
          and keepdims is True
      ):
          if axis == 1:
              y = np.zeros((x.shape[0], 1), dtype=x.dtype)
              _x = ffi.cast("float *", ffi.from_buffer(x))
              _y = ffi.cast("float *", ffi.from_buffer(y))
              NervanaObject.be.mathlib.cmath_sum(
                  _x, 1, x.shape[0], x.shape[1], _y
              )
              return y
          elif axis == 0:
              y = np.zeros((1, x.shape[1]), dtype=x.dtype)
              _x = ffi.cast("float *", ffi.from_buffer(x))
              _y = ffi.cast("float *", ffi.from_buffer(y))
              NervanaObject.be.mathlib.cmath_sum(
                  _x, 0, x.shape[0], x.shape[1], _y
              )
              return y
          else:
              raise AttributeError(
                  "axis of a 2d tensor should only be 0 or 1"
              )
      else:
          return np.sum(x, axis=axis, keepdims=keepdims)
  
imports: import sys
  import numpy
  from cffi import FFI
  from neon import NervanaObject
  from neon.transforms import Rectlinclip
label_desc: Use image node_id 22 for calling a global function with example usage: sum(x, axis, keepdims) and returns: np, y, y