Tensorflow: Using tf.slice to split the input

后端 未结 3 1344
梦毁少年i
梦毁少年i 2021-02-20 03:22

I\'m trying to split my input layer into different sized parts. I\'m trying to use tf.slice to do that but it\'s not working.

Some sample code:

import te         


        
3条回答
  •  余生分开走
    2021-02-20 04:10

    You can also try out this one

    x = tf.slice(ph, [0,0], [3, 2])

    As your starting point is (0,0) second argument is [0,0]. You want to slice three raw and two column so your third argument is [3,2].

    This will give you desired output.

提交回复
热议问题