How to get Tensorflow tensor dimensions (shape) as int values?

后端 未结 6 1808
孤城傲影
孤城傲影 2020-12-12 20:23

Suppose I have a Tensorflow tensor. How do I get the dimensions (shape) of the tensor as integer values? I know there are two methods, tensor.get_shape() and

6条回答
  •  再見小時候
    2020-12-12 20:37

    Another way to solve this is like this:

    tensor_shape[0].value
    

    This will return the int value of the Dimension object.

提交回复
热议问题