先给出tf.one_hot的用例:(例子转自https://www.jianshu.com/p/c5b4ec39713b) import tensorflow as tf var0 = tf.one_hot(indices=[1, 2, 3], depth=3, axis=0) var1 = tf.one_hot(indices=[1, 2, 3], depth=4, axis=0) var2 = tf.one_hot(indices=[1, 2, 3], depth=4, axis=1) #…