speed optimize for segment_softmax
@@ -289,6 +289,8 @@ def segment_softmax(data, segment_ids):
[1. 1. 1. ]]
"""
+ with paddle.no_grad():
+ # no need gradients
data_max = segment_max(data, segment_ids)
data_max = paddle.gather(data_max, segment_ids, axis=0)
data = data - data_max
