1、用命令行进入tensorflow的python编程位置
C:\Users\aDreamer>activate tensorflow
(tensorflow) C:\Users\aDreamer>python
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
2、输入代码
>>> import tensorflow as tf #加载tensorflow(导入tensorflow包)
>>> m1=tf.constant([[3,3]]) #定义矩阵常量m1、m2
>>> m2=tf.constant([[2],[3]])
>>> product=tf.matmul(m1,m2) #创建矩阵乘法op,m1、m2相乘
>>> print(product) #打印op
Tensor("MatMul:0", shape=(1, 1), dtype=int32)
>>> sess=tf.Session() #创建会话
2019-05-27 08:41:23.500628: I tensor