博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
tensor shape can be flexible to determined in Tensorflow
阅读量:4079 次
发布时间:2019-05-25

本文共 653 字,大约阅读时间需要 2 分钟。

I would like to record the usage of tensor shape in Tensorflow.

Suppose a tensor variable A, as before, I would to use the usage A.get_shape() to detect its shape, while this usage has a crucial disadvantage. For example:

A = tf.placeholder(dtype=tf.float32, shape=[None, 28, 281])

At present, we want get the first element values of the shape of A. If we use A.get_shape()[0].value, it will result in None. While if we use tf.shape(A)[0], we will get the real value for the corresponding value.

BTW, A.get_shape()[0] could be performed without the Session initialization, but tf.shape(A)[0] needs to be performed after the Session has been initialized.

转载地址:http://eoini.baihongyu.com/

你可能感兴趣的文章
《数据库系统概论》 第一章 绪论
查看>>
《数据库系统概论》 第二章 关系数据库
查看>>
《数据库系统概论》 第三章 关系数据库标准语言SQL
查看>>
SQL语句(二)查询语句
查看>>
SQL语句(六) 自主存取控制
查看>>
《计算机网络》第五章 运输层 ——TCP和UDP 可靠传输原理 TCP流量控制 拥塞控制 连接管理
查看>>
堆排序完整版,含注释
查看>>
二叉树深度优先遍历和广度优先遍历
查看>>
生产者消费者模型,循环队列实现
查看>>
PostgreSQL代码分析,查询优化部分,process_duplicate_ors
查看>>
PostgreSQL代码分析,查询优化部分,canonicalize_qual
查看>>
PostgreSQL代码分析,查询优化部分,pull_ands()和pull_ors()
查看>>
IA32时钟周期的一些内容
查看>>
获得github工程中的一个文件夹的方法
查看>>
《PostgreSQL技术内幕:查询优化深度探索》养成记
查看>>
PostgreSQL查询优化器详解之逻辑优化篇
查看>>
STM32中assert_param的使用
查看>>
C语言中的 (void*)0 与 (void)0
查看>>
vu 是什么
查看>>
io口的作用
查看>>