python - Tensorflow large tensor split to small tensor -
i have tensor below
x = tf.variable(tf.truncated_normal([batch, input]), stddev=0.1))
assume batch = 99, input= 5, , split small tensor.
if x below:
[[1.0, 2.0, 3.0, 4.0, 5.0] [2.0, 3.0, 4.0, 5.0, 6.0] [3.0, 4.0, 5.0, 6.0, 7.0] [4.0, 5.0, 6.0, 7.0, 8.0] ......................... ......................... ......................... [44.0, 55.0, 66.0, 77.0, 88.0] [55.0, 66.0, 77.0, 88.0, 99.0]]
i want split 2 tensors
[[1.0, 2.0, 3.0, 4.0, 5.0] [2.0, 3.0, 4.0, 5.0, 6.0] [3.0, 4.0, 5.0, 6.0, 7.0]]
and
[4.0, 5.0, 6.0, 7.0, 8.0] ......................... ......................... [44.0, 55.0, 66.0, 77.0, 88.0] [55.0, 66.0, 77.0, 88.0, 99.0]]
i don't know how use tf.split
split row.
an expedient way call tf.slice
twice.
Comments
Post a Comment