Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AI and Deep Learning by (850 points)

Is tf.contrib.layers.flatten(x) the same as tf.reshape(x, [n, 1])?

Can anyone help me with this?
 

1 Answer

0 votes
by (119k points)

tf.contrib.layers.flatten(x) flattens the input and the flattened tensor with shape [batch_size, k]. Does not affect the batch size. It is equivalent to the following:

flattened = tf.reshape(x, [tf.shape(x)[0], -1])

If you want to learn Artificial Intelligence using TensorFlow, then check out this Artificial Intelligence Course by Intellipaat.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.5k answers

500 comments

108k users

Browse Categories

...