tf squeeze 28 29

Solutions on MaxInterview for tf squeeze 28 29 by the best coders in the world

showing results for - "tf squeeze 28 29"
Jonah
28 Mar 2020
1Removes dimensions of size 1 from the shape of a tensor.
2
3tf.squeeze(
4    input, axis=None, name=None
5)
6
7Given a tensor input, this operation returns a tensor of the same 
8type with all dimensions of size 1 removed. If you don't want to 
9remove all size 1 dimensions, you can remove specific size 1 
10dimensions by specifying axis.
11
12Example:
13# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
14tf.shape(tf.squeeze(t))  # [2, 3]
15# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
16tf.shape(tf.squeeze(t, [2, 4]))  # [1, 2, 3, 1]