TF随笔-13
import tensorflow as tf
a=tf.constant(5)
b=tf.constant(3)
res1=tf.divide(a,b)
res2=tf.div(a,b)
with tf.Session() as sess:
print sess.run(res1)
print sess.run(res2)
输出:
1.66666666667
1
TF随笔-13的更多相关文章
- TF随笔-4
>>> import tensorflow as tf>>> a=tf.constant([[1,2],[3,4]])>>> b=tf.const ...
- TF随笔-11
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import tensorflow as tf my_var=tf.Variable(0.) step=t ...
- TF随笔-10
#!/usr/bin/env python# -*- coding: utf-8 -*-import tensorflow as tf x = tf.constant(2)y = tf.constan ...
- TF随笔-9
计算累加 #!/usr/bin/env python2 # -*- coding: utf-8 -*-"""Created on Mon Jul 24 08:25:41 ...
- TF随笔-8
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Jul 10 09:35:04 201 ...
- TF随笔-7
求平均值的函数 reduce_mean axis为1表示求行 axis为0表示求列 >>> xxx=tf.constant([[1., 10.],[3.,30.]])>> ...
- tf随笔-6
import tensorflow as tfx=tf.constant([-0.2,0.5,43.98,-23.1,26.58])y=tf.clip_by_value(x,1e-10,1.0)ses ...
- tf随笔-5
# -*- coding: utf-8 -*-import tensorflow as tfw1=tf.Variable(tf.random_normal([2,6],stddev=1))w2=tf. ...
- TF随笔-3
>>> import tensorflow as tf>>> node1 = tf.constant(3.0, dtype=tf.float32)>>& ...
随机推荐
- Scala的类与类型
类和类型 List<String>和List<Int>类型是不一样的,但是jvm运行时会采用泛型擦除.导致List<String>和List<Int>都 ...
- The same month as the adidas NMD Singapore is releasing
Earlier this December 2017, the inaugural adidas NMD Singapore silhouette released in the first colo ...
- MyBatis—mybatis-config.xml配置介绍
在定义sqlSessionFactory时需要指定MyBatis主配置文件: Xml代码 说明: 收藏代码 1. <bean id="sqlSessionFactory" ...
- 2018 Multi-University Training Contest 4 Solution
A - Problem A. Integers Exhibition 留坑. B - Problem B. Harvest of Apples 题意:计算$\sum_{i = 0}^{i = m}C( ...
- React 根据 state 修改className
className={ this.state.isLike ? 'active iconfont icon-xihuan' : 'iconfont icon-xihuan1' }
- sqoop2-1.99.5-cdh5.5.4.tar.gz的部署搭建
不多说,直接上干货! 首先,说下博主我,为什么,好端端的Sqoop1用的好好的,然后又安装和学习Sqoop2? 因为,在Cloudera Hue里的Sqoop,是需要Sqoop2. HUE配置文件hu ...
- POI之Excel导入
1,maven配置 <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-oox ...
- kali_常用软件记录
可参考:http://www.lvzejun.cn/2015/03/31/ubuntu-software/ 录屏软件 http://www.kohaupt-online.de/hp/ http://l ...
- BZOj 墨墨的等式(转化为最短路)题解
题意:中文题意不解释... 思路:这道题居然可以转化为最短路orz,要等式有非负整数解,我们可以转化一下:每个ai不限数量,问你能用ai数组拼出多少个Bmin~Bmax范围内的数,有点像完全背包的感觉 ...
- JAVA_返回一个数值的相反数的几种方式.
一个方法接收一个int类型值,需要返回它的相反数. 如传入1,返回-1 传入-22,返回22 最简单的方式是return 0-number; 还有其他方式: public class Kata { p ...