I am new to TensorFlow and I am formatting some data to feed into a repeating neural network. My data is given by a three-dimensional tensor filed in the placeholder x. I want to divide xby the 3rd dimension, and for this I have (note that it n_timestepscorresponds to the length xalong the 3rd dimension):
x = tf.split (x, n_timesteps, axis = 2)
Although, as I tried with numpy:
x = np.split (x, n_timesteps, axis = 2)
If it xis 3d ndarray, it np.splitwill return a list of arrays n_timestepswith size 3, so the 3-dimensional dimension is single-point. C numpyI know that I can easily solve this, using, np.squeezetogether with the list, to remove the size of a singleton:
x = [np.squeeze(a, axis=2) for a in np.split(x, n_timesteps, axis=2)]
But how can I do the same on TF?