0

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?

Wyetro
  • 8,439
  • 9
  • 46
  • 64
agupta231
  • 1,161
  • 2
  • 14
  • 24
  • possible duplicate: http://stackoverflow.com/questions/34913762/how-to-expand-a-tensorflow-variable – gidim Jul 07 '16 at 17:00

1 Answers1

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.

borgr
  • 20,175
  • 6
  • 25
  • 35
rrao
  • 629
  • 4
  • 13