Tensorflow学习笔记(2)-基本运算
来源:互联网 发布:java 蓝牙通信协议 编辑:程序博客网 时间:2024/05/21 08:44
# -*- coding: utf-8 -*-# @Time : 17-8-1 下午8:02# @Author : 未来战士biubiu!!# @FileName: 2-basic operation.py# @Software: PyCharm Community Edition# @Blog :http://blog.csdn.net/u010105243/article/import tensorflow as tf#第一种计算方式# a = tf.constant(2)# b = tf.constant(3)# with tf.Session() as sess:# print("a:%i" % sess.run(a), "b:%i" % sess.run(b))# print("a+b=%i"%sess.run(a+b))#第二种计算方式# a = tf.placeholder(tf.int16)# b = tf.placeholder(tf.int16)# add = tf.add(a, b)# mul = tf.multiply(a, b)# with tf.Session() as sess:# print("a+b=%i" % sess.run(add, feed_dict={a: 2, b: 3}))# print("a*b=%i" % sess.run(mul, feed_dict={a: 2, b: 3}))#矩阵运算mat1 = tf.constant([[2., 3.]])mat2 = tf.constant([[2.], [2.]])product = tf.matmul(mat1, mat2)with tf.Session() as sess: print(sess.run(product))
阅读全文
0 0
- Tensorflow学习笔记(2)-基本运算
- TensorFlow学习笔记2:基本运算
- TensorFlow学习笔记02:TensorFlow基本简介
- TensorFlow学习笔记2——数据类型及简单运算
- TensorFlow学习笔记(十九) 基本算术运算和Reduction归约计算
- python tensorflow学习笔记(三)运算
- tensorflow学习笔记----一(基本使用)
- 【学习笔记】TensorFlow 入门之基本使用
- Tensorflow学习笔记(2)
- Tensorflow学习笔记2
- TensorFlow学习笔记2
- tensorflow 学习笔记 2
- TensorFlow学习笔记(1)--TensorFlow简介,常用基本操作
- [TensorFlow学习笔记1]TensorFLow的基本概念和基本使用
- TensorFlow学习笔记--TensorFlow简介,常用基本操作
- tensorflow学习笔记(一)——tensorflow基本使用
- iOS学习笔记其2-基本运算与程序控制流程
- Swift2.2 学习笔记(九) ___基本运算符
- QS Network (最小生成树——prim方法)
- Android获取图片Uri/path
- java 环境变量的配置
- 1019. General Palindromic Number (20)
- 2017.8.1暑假集训第二天(下午训练赛)
- Tensorflow学习笔记(2)-基本运算
- 七月小结
- 洛谷1983(DAG上最长路)
- 中国剩余定理介绍
- 自动驾驶的技术架构和生态发展
- 4349: 最小树形图
- 2017暑假集训第二天
- G
- 1023. Have Fun with Numbers (20)