code: def segment_sum(data, segment_ids, num_segments=None, sorted=False):
      if sorted:
          return tf.math.segment_sum(data, segment_ids)
      else:
          if num_segments is None:
              unique_segment_ids, _ = tf.unique(segment_ids)
              num_segments = tf.shape(unique_segment_ids)[0]
          return tf.math.unsorted_segment_sum(
              data, segment_ids, num_segments
          )
  
file_path: keras/keras/backend/tensorflow/math.py
imports: import tensorflow
  from keras.backend import standardize_dtype
  from keras.backend.tensorflow.core import convert_to_tensor
label_desc: Use image node_id 1 for calling a global function with example usage: segment_sum(data, segment_ids, num_segments, sorted) and returns: tf, tf