1c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
2tf.math.segment_sum(c, tf.constant([0, 0, 1]))
3# ==> [[0 0 0 0]
4# [5 6 7 8]]
1#Tensorflow is a popular, free, open-source software library for machine learning and AI. But It specializes on DNN training and inference.
2import tensorflow as tf #import tensorflow in python
3print(tf.__version__) #print tensorflow version
4