sess=tf.Session()

a=np.array([1,2,3,5.])   # 此代码保留为浮点数

a1=np.array([1,2,3,5])   # 此代码保留为整数
c=tf.reduce_mean(a)
d=sess.run(c)
print(a)
print(d)
c1=tf.reduce_mean(a1)
d1=sess.run(c1)
print(a1)
print(d1)
总结:tf.reduce_mean(a,axis)是均值,其中a是输入矩阵,axis是从什么维度求均值。然而,代码运行发现,a为浮点数,返回为浮点数,a为整数,返回为向下取的整数。

最新文章

  1. 【Prince2是什么】PRINCE2认证之Prince2衡量绩效的六大要素
  2. 深入理解定位父级offsetParent及偏移大小
  3. Html定位精要
  4. 阿里云部署Java web项目初体验(转)/linux 上配置jdk和安装tomcat
  5. JavaScript类型判断
  6. PAC学习框架
  7. Android ViewPager刷新解析
  8. 小结JS中的OOP(中)
  9. 0_Simple__simpleAssert + 0_Simple__simpleAssert_nvrtc
  10. 程序猿必知必会Linux命令之awk
  11. seed实验——Set-UID Program Vulnerability实验
  12. 通过DFS求解有向图(邻接表存储)中所有简单回路
  13. Spring 拦截器postHandle无法修改Response的原因
  14. 【Zookeeper系列】ZooKeeper伸缩性(转)
  15. [LeetCode&Python] Problem 748. Shortest Completing Word
  16. 【Python】exe2shellcode,shellcode2exe
  17. spring boot 多数据源分布式事务处理
  18. SVG基础图形和D3.js
  19. P4427 [BJOI2018]求和
  20. Python 出现错误 SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform.

热门文章

  1. jvm(三)指令重排 & 内存屏障 & 可见性 & volatile & happen before
  2. bitcoinjs-lib 哈希交易之多笔交易合并。
  3. Oracle的“ORA-00937: 不是单组分组函数” 如何解决?
  4. kafka window环境下使用(内置zookeeper)
  5. c++ Array运用实例
  6. 在idea中打开maven项目pom.xml未识别
  7. webuploader超时时间timeout设置
  8. Flask自动刷新前端页面(方便调试)livereload
  9. 简单工厂(二)——coding
  10. 深入Nginx之《常用参数配置技巧》