tf.split函数的用法(tensorflow1.13.0)
作者:互联网
tf.split(input, num_split, dimension):
dimension指输入张量的哪一个维度,如果是0就表示对第0维度进行切割;num_split就是切割的数量,如果是2就表示输入张量被切成2份,每一份是一个列表。
例如:
import tensorflow as tf; import numpy as np; A = [[1,2,3],[4,5,6]] x = tf.split(A, 3, 1) with tf.Session() as sess: c = sess.run(x) for ele in c: print( ele )
输出:
[[1]
[4]]
[[2]
[5]]
[[3]
[6]]
标签:sess,tensorflow1.13,ele,num,split,tf,import 来源: https://www.cnblogs.com/HYWZ36/p/11408451.html