Currently I have a neural network that convolutes and pools images. However, right before I make my densely connected layer, I want to add some information. Currently, I reshape my image to a flat tensor with tf.reshape(image, [width * length * channels])
, but I was wondering how I could append a couple of tf.float32
values to the end of the tensor?
Asked
Active
Viewed 2,859 times
0
-
possible duplicate: http://stackoverflow.com/questions/34913762/how-to-expand-a-tensorflow-variable – gidim Jul 07 '16 at 17:00
1 Answers
2
You can reshape to a vector using tf.reshape with -1
:
tf.reshape(image, [-1])
and append the new values as Tensors using tf.concat:
tf.concat([image, new_val1, new_val2], 0)
This will return a Tensor resulting from concatenation of the input tensors.