对于如何创建图并开启session,参考如下 # -- encoding:utf-8 -- import tensorflow as tf # 定义常量矩阵a和矩阵b a=tf.constant([[1,2],[3,4]],dtype=tf.int32) b=tf.constant([5,6,7,8],dtype=tf.int32,shape=[2,2]) # 2.以a和b做为输入,进行矩阵的乘法操作. c=tf.matmul(a,b,name='matmu1') print(type(c))…