tensorflow 除法
来源:互联网 发布:c语言abs函数不存在 编辑:程序博客网 时间:2024/05/17 22:49
import tensorflow as tfa1 = tf.constant([[1,2],[3,4],[5,6]])a2 = tf.constant([[[1],[2]],[[3],[4]],[[5],[6]]])a3 = tf.constant([[[[1]],[[2]]],[[[3]],[[4]]],[[[5]],[[6]]]])r1 = a1/tf.constant(2)r2 = a2/tf.constant(2)r3 = a3/tf.constant(2)sess = tf.Session()print(sess.run(r1))print(sess.run(r2))print(sess.run(r3))
[[ 0.5 1. ]
[ 1.5 2. ]
[ 2.5 3. ]]
[[[ 0.5]
[ 1. ]]
[[ 1.5]
[ 2. ]]
[[ 2.5]
[ 3. ]]]
[[[[ 0.5]]
[[ 1. ]]]
[[[ 1.5]]
[[ 2. ]]]
[[[ 2.5]]
[[ 3. ]]]]
也就是说无论多少维的tensor,都是对于最终的每个元素都除的
阅读全文
0 0
- tensorflow 除法
- 除法
- 除法
- 除法
- 除法
- 除法
- 除法
- 除法
- 除法
- 高精度除法(大数除法)
- tensorflow
- TensorFlow
- TensorFlow
- tensorflow
- tensorflow
- tensorflow
- Tensorflow
- Tensorflow
- 3 种 web 会话管理的方式
- 各种中国镜像
- 2017云栖大会开源峰会预告
- quartz 中JobExecutionContext的使用
- Oracle中生成随机数方法
- tensorflow 除法
- win10音频问题
- Spring源码分析IOC实现一BeanFactory
- 指数分布
- 单向加密——使用java加密Base64算法
- STL_string
- Android 环信获取好友异常,被catch掉
- 老崴脚会成习惯性损伤?
- 关于glReadPixels的两点心得