tf.argsort

tf 的排序,返回对应值的排名

import tensorflow as tf
a = [1, 10, 26.9, 2.8, 166.32, 62.3]
b = tf.argsort(a,axis=-1,direction='ASCENDING',stable=False,name=None)
c = tf.keras.backend.eval(b)
# Here, c = [0 3 1 2 5 4]
posted @ 2022-08-19 22:51  luoganttcc  阅读(4)  评论(0)    收藏  举报