1. 程式人生 > >tf.split()

tf.split()

import numpy as np
import tensorflow as tf
a=np.reshape(range(24),(4,2,3))

sess=tf.InteractiveSession()
b= tf.split(a,1,0)

c=sess.run(b)

切割

c
Out[37]: 
[array([[[ 0,  1,  2],
         [ 3,  4,  5]],
 
        [[ 6,  7,  8],
         [ 9, 10, 11]],
 
        [[12, 13, 14],
         [15, 16, 17]],
 
        [[18, 19, 20],
         [21, 22, 23]]])]