import tensorflow as tf
tensor = [[[1,2,3],
[4,5,6],
[7,8,9]]]
with tf.Session() as sess:
tensor1, tensor2 = tf.split(tensor, [1,2], 2) #将tensor在第2个维度(基1)切为1份和2份
print(tensor2 .eval())
代码运行结果:
[[[2 3]
[5 6]
[8 9]]]
来源:CSDN
作者:不喝牛奶的里昂
链接:https://blog.csdn.net/qq_34895059/article/details/103465782