博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
2-13 常量变量四则运算
阅读量:5064 次
发布时间:2019-06-12

本文共 3536 字,大约阅读时间需要 11 分钟。

## Activate greedy completion PENDING DEPRECTION. this is now mostly taken care#  of with Jedi.#  #  This will enable completion on elements of lists, results of function calls,#  etc., but can be unsafe because the code is actually evaluated on TAB.c.Completer.greedy = False## Experimental: restrict time (in milliseconds) during which Jedi can compute#  types. Set to 0 to stop computing types. Non-zero value lower than 100ms may#  hurt performance by preventing jedi to build its cache.c.Completer.jedi_compute_type_timeout = 400## Experimental: Use Jedi to generate autocompletions. Off by default.c.Completer.use_jedi = False
## Activate greedy completion PENDING DEPRECTION. this is now mostly taken care#  of with Jedi.#  #  This will enable completion on elements of lists, results of function calls,#  etc., but can be unsafe because the code is actually evaluated on TAB.c.Completer.greedy = True## Experimental: restrict time (in milliseconds) during which Jedi can compute#  types. Set to 0 to stop computing types. Non-zero value lower than 100ms may#  hurt performance by preventing jedi to build its cache.c.Completer.jedi_compute_type_timeout = 400## Experimental: Use Jedi to generate autocompletions. Off by default.c.Completer.use_jedi = True

C:\Users\ZHONGZHENHUA\.ipython\profile_default\ipython_config.py

import tensorflow as tfdata1 = tf.constant(6)data2 = tf.constant(2)dataAdd = tf.add(data1,data2)dataMul = tf.multiply(data1,data2)dataSub = tf.subtract(data1,data2)dataDiv = tf.divide(data1,data2)with tf.Session() as sess:    print(sess.run(dataAdd))    print(sess.run(dataMul))    print(sess.run(dataSub))    print(sess.run(dataDiv))print('end!')

import tensorflow as tfdata1 = tf.constant(6)data2 = tf.Variable(2)dataAdd = tf.add(data1,data2)dataMul = tf.multiply(data1,data2)dataSub = tf.subtract(data1,data2)dataDiv = tf.divide(data1,data2)init = tf.global_variables_initializer()with tf.Session() as sess:    print(sess.run(init))    print(sess.run(dataAdd))    print(sess.run(dataMul))    print(sess.run(dataSub))    print(sess.run(dataDiv))print('end!')

import tensorflow as tfdata1 = tf.constant(6)data2 = tf.Variable(2)#data2 = tf.constant(2)dataAdd = tf.add(data1,data2)dataCopy = tf.assign(data2,dataAdd)# dataAdd ->data2dataMul = tf.multiply(data1,data2)dataSub = tf.subtract(data1,data2)dataDiv = tf.divide(data1,data2)init = tf.global_variables_initializer()with tf.Session() as sess:    print(sess.run(init))    print(sess.run(dataAdd))    print(sess.run(dataMul))    print(sess.run(dataSub))    print(sess.run(dataDiv))    print('sess.run(dataCopy)',sess.run(dataCopy))    print('dataCopy.eval()',dataCopy.eval())    print('tf.get_default_session()',tf.get_default_session().run(dataCopy))print('end!')

import tensorflow as tfdata1 = tf.constant(6)data2 = tf.Variable(2)#data2 = tf.constant(2)dataAdd = tf.add(data1,data2)dataCopy = tf.assign(data2,dataAdd)# dataAdd ->data2dataMul = tf.multiply(data1,data2)dataSub = tf.subtract(data1,data2)dataDiv = tf.divide(data1,data2)init = tf.global_variables_initializer()with tf.Session() as sess:    print(sess.run(init))    print(sess.run(dataAdd))    print(sess.run(dataMul))    print(sess.run(dataSub))    print(sess.run(dataDiv))    print('sess.run(dataCopy)',sess.run(dataCopy))#8->data2    print('dataCopy.eval()',dataCopy.eval())#8+6->14->data2 = 14    print('tf.get_default_session()',tf.get_default_session().run(dataCopy))#14+6->20->data2 = 20 sess.run() tensor.eval()print('end!')

 

转载于:https://www.cnblogs.com/ZHONGZHENHUA/p/9608559.html

你可能感兴趣的文章
session如何保存在专门的StateServer服务器中
查看>>
react展示数据
查看>>
测试计划
查看>>
idea设置自定义图片
查看>>
[高级]Android多线程任务优化1:探讨AsyncTask的缺陷
查看>>
选择器
查看>>
rownum 的使用
查看>>
Mysql与Oracle 的对比
查看>>
MVC系列博客之排球计分(三)模型类的实现
查看>>
阅读笔记02
查看>>
2019年春季学期第二周作业
查看>>
2014北邮计算机考研复试上机题解(上午+下午)
查看>>
mySQL 教程 第7章 存储过程和函数
查看>>
OGG同步Oracle到Kafka(Kafka Connect Handler)
查看>>
算法笔记_056:蓝桥杯练习 未名湖边的烦恼(Java)
查看>>
idea的maven项目无法引入junit
查看>>
jquery实现限制textarea输入字数
查看>>
thinkphp5 csv格式导入导出(多数据处理)
查看>>
页面置换算法-LRU(Least Recently Used)c++实现
查看>>
如何获取Android系统时间是24小时制还是12小时制
查看>>