取得tensor里的shape操作

来源:互联网 发布:电视机的电视直播软件 编辑:程序博客网 时间:2024/06/05 05:39
import tensorflow as tf
import numpy as np
x=tf.placeholder(dtype = tf.float32, shape = (256,32,32,3),name = 'y')
shape=x.shape.as_list()
shape
[256, 32, 32, 3]