For me, I tried another example to let me understand the cut function
input = [ [[11, 12, 13], [14, 15, 16]], [[21, 22, 23], [24, 25, 26]], [[31, 32, 33], [34, 35, 36]], [[41, 42, 43], [44, 45, 46]], [[51, 52, 53], [54, 55, 56]], ] s1 = tf.slice(input, [1, 0, 0], [1, 1, 3]) s2 = tf.slice(input, [2, 0, 0], [3, 1, 2]) s3 = tf.slice(input, [0, 0, 1], [4, 1, 1]) s4 = tf.slice(input, [0, 0, 1], [1, 0, 1]) s5 = tf.slice(input, [2, 0, 2], [-1, -1, -1])
It outputs:
[[[21 22 23]]] [[[31 32]] [[41 42]] [[51 52]]] [[[12]] [[22]] [[32]] [[42]]] [] [[[33] [36]] [[43] [46]] [[53] [56]]]
The parameter begins to indicate which element you are going to cut. The dimension parameter means how many elements you want in this dimension.