上一页 1 ··· 330 331 332 333 334 335 336 337 338 ··· 344 下一页
摘要: 为了取回操作的输出内容, 可以在使用 Session 对象的 run() 调用 执行图时,传入一些 tensor, 这些 tensor 会帮助你取回结果. 在之前的例子里,我们只取回了单个节点 state, 但是你也可以取回多个 tensor:import ... 阅读全文
posted @ 2018-10-01 10:46 luoganttcc 阅读(117) 评论(0) 推荐(0)
摘要: import tensorflow as tf# 创建一个常量 op, 产生一个 1x2 矩阵. 这个 op 被作为一个节点# 加到默认图中.## 构造器的返回值代表该常量 op 的返回值.matrix1 = tf.constant([[3., 3.]])#... 阅读全文
posted @ 2018-10-01 10:35 luoganttcc 阅读(125) 评论(0) 推荐(0)
摘要: CPUwith tf.Session() as sess: ...: with tf.device("/cpu:0"): ...: m1=tf.constant([[3,3]]) ...: m2=tf... 阅读全文
posted @ 2018-10-01 10:17 luoganttcc 阅读(115) 评论(0) 推荐(0)
摘要: 可变参数允许你传入0个或任意个参数,这些可变参数在函数调用时自动组装为一个tuple。而关键字参数允许你传入0个或任意个含参数名的参数,这些关键字参数在函数内部自动组装为一个dictdef person(name,age,**kw): ... 阅读全文
posted @ 2018-09-30 14:31 luoganttcc 阅读(111) 评论(0) 推荐(0)
摘要: def add1(*data): sum = 0 for i in data: sum = sum + i return sumprint( add1(1,2,3,4,5) )print( add1... 阅读全文
posted @ 2018-09-30 14:06 luoganttcc 阅读(86) 评论(0) 推荐(0)
摘要: Python下一切皆对象,每个对象都有多个属性(attribute),Python对属性有一套统一的管理方案。__dict__与dir()的区别: dir()是一个函数,返回的是list; __dict__是一个字典,键为属性名,值为属性值; ... 阅读全文
posted @ 2018-09-29 17:27 luoganttcc 阅读(83) 评论(0) 推荐(0)
摘要: class Student: count=0 def __init__(self,name,age): self.name=name self.age=age Student.count+=1 ... 阅读全文
posted @ 2018-09-29 17:10 luoganttcc 阅读(164) 评论(0) 推荐(0)
摘要: sudo apt-get purge nvidia*reboot 阅读全文
posted @ 2018-09-27 18:40 luoganttcc 阅读(403) 评论(0) 推荐(0)
摘要: 链接 阅读全文
posted @ 2018-09-27 12:08 luoganttcc 阅读(138) 评论(0) 推荐(0)
摘要: #!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Wed Sep 26 12:41:46 2018@author: luogan"""import numpy as npfrom matpl... 阅读全文
posted @ 2018-09-26 12:44 luoganttcc 阅读(97) 评论(0) 推荐(0)
上一页 1 ··· 330 331 332 333 334 335 336 337 338 ··· 344 下一页