How to get the dimensions of a tensor (in TensorFlow) at graph construction time?
I see most people confused about tf.shape(tensor) and tensor.get_shape() Let’s make it clear: tf.shape tf.shape is used for dynamic shape. If your tensor’s shape is changable, use it. An example: a input is an image with changable width and height, we want resize it to half of its size, then we can write something like: … Read more