import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'

import tensorflow as tf
matrix1 = tf.constant([[3,3]])
matrix2 = tf.constant([[2],[2]])
protuct = tf.matmul(matrix1,matrix2)

# sess = tf.Session()
# result = sess.run(protuct)

# print(result)
# sess.close()

with tf.Session() as sess:
result = sess.run(protuct)
print(result)

莫烦tensorflow(2)-Session的更多相关文章

  1. 莫烦tensorflow(9)-Save&Restore

    import tensorflow as tfimport numpy as np ##save to file#rember to define the same dtype and shape w ...

  2. 莫烦tensorflow(8)-CNN

    import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#number 1 to 10 dat ...

  3. 莫烦tensorflow(7)-mnist

    import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#number 1 to 10 dat ...

  4. 莫烦tensorflow(6)-tensorboard

    import tensorflow as tfimport numpy as np def add_layer(inputs,in_size,out_size,n_layer,activation_f ...

  5. 莫烦tensorflow(5)-训练二次函数模型并用matplotlib可视化

    import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt def add_layer(inputs,in_siz ...

  6. 莫烦tensorflow(4)-placeholder

    import tensorflow as tf input1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32) outpu ...

  7. 莫烦tensorflow(3)-Variable

    import tensorflow as tf state = tf.Variable(0,name='counter') one = tf.constant(1) new_value = tf.ad ...

  8. 莫烦tensorflow(1)-训练线性函数模型

    import tensorflow as tfimport numpy as np #create datax_data = np.random.rand(100).astype(np.float32 ...

  9. tensorflow学习笔记-bili莫烦

    bilibili莫烦tensorflow视频教程学习笔记 1.初次使用Tensorflow实现一元线性回归 # 屏蔽警告 import os os.environ[' import numpy as ...

随机推荐

  1. windows开启Apache的mod_rewrite模块

    windows下安装apache默认是没有开启mod_rewrite模块的,启用也很简单,修改apache配置文件httpd.conf,查找rewrite_module, 找到这行:#LoadModu ...

  2. leetcode-algorithms-30 Substring with Concatenation of All Words

    leetcode-algorithms-30 Substring with Concatenation of All Words You are given a string, s, and a li ...

  3. js时间与时间戳互相转换

    var _time1 = Date.parse(new Date(‘2017-05-02 00:00:00’))/1000; //将设定的日期转换为时间戳 _time1 = getLocalTime( ...

  4. Oracle修改监听端口教程

    Oracle默认监听端口1521,一众扫描器通常通过探测1521端口是否开启来探测是否存在Oracle服务,如果修改默认监听端口在一定程度上可以提升数据库和主机的安全性. 比如这里我们修改成2521为 ...

  5. Linux网卡性能查看(CentOS)

    一.ethtool查看网卡带宽 ethtool eth0 #eth0为网卡名,使用ifconfig查看当前使用的网卡 Speed表示网卡带宽,Duplex表示工作模式,Supported link m ...

  6. 牛客网 PAT 算法历年真题 1008 : 锤子剪刀布 (20)

    锤子剪刀布 (20) 时间限制 1000 ms 内存限制 32768 KB 代码长度限制 100 KB 判断程序 Standard (来自 小小) 题目描述 大家应该都会玩“锤子剪刀布”的游戏:现给出 ...

  7. 查看mysql版本

    方法一:show variables like 'version'; 方法二:select version();

  8. @GeneratedValue 四种标准用法为TABLE,SEQUENCE,IDENTITY,AUTO.

    一.JPA通用策略生成器 通过annotation来映射hibernate实体的,基于annotation的hibernate主键标识为@Id, 其生成规则由@GeneratedValue设定的.这里 ...

  9. Java版本知识

    1zip是压缩包,而MSI文件是Windows Installer的数据包,它实际上是一个数据库,包含安装一种产品所需要的信息和在很多安装情形下安装(和卸载)程序所需的指令和数据,只要系统中包含win ...

  10. laravel中判断当前页面与连接地址是否一致,并添加效果: