Converting 1 D tensor to 2 D tensor in tensor flow

Viewed 22

Below is my sample code

sample = np.array([-7.0,-4.0,-1.0,2.0,5.0,8.0,11.0,14.0,15.0])
sample = tf.convert_to_tensor(sample)
tf.reshape(sample, shape=(3,3)),X.ndim

How to convert this 1D tensor to 2D tensor, I am bit confused. I tried multiple ways but it is always returning ndim as 1.

Could anyone please help

0 Answers
Related