import tensorflow as tf logits = tf.random.uniform([1,10],minval=-2,maxval=2) print(‘logits:‘,logits) prob = tf.nn.softmax(logits) print(‘softmax后:‘,prob) p_sum = tf.reduce_sum(prob) print(‘相加值:‘,p_sum)
原文:https://www.cnblogs.com/cxhzy/p/13509638.html