zl程序教程

您现在的位置是:首页 >  其它

当前栏目

tf.argsort

TF
2023-09-14 09:09:28 时间

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]