Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8b0980b8
提交
8b0980b8
authored
7月 23, 2015
作者:
Iban Harlouchet
提交者:
Arnaud Bergeron
9月 08, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
testcode for doc/extending/graphstructures.txt
上级
4b8b6eee
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
21 行增加
和
9 行删除
+21
-9
graphstructures.txt
doc/extending/graphstructures.txt
+21
-9
没有找到文件。
doc/extending/graphstructures.txt
浏览文件 @
8b0980b8
...
@@ -18,10 +18,12 @@ should help you understand how these pieces fit together:
...
@@ -18,10 +18,12 @@ should help you understand how these pieces fit together:
**Code**
**Code**
..
code-block:: python
..
testcode::
x = dmatrix('x')
import theano.tensor as T
y = dmatrix('y')
x = T.dmatrix('x')
y = T.dmatrix('y')
z = x + y
z = x + y
**Diagram**
**Diagram**
...
@@ -72,7 +74,7 @@ This is what you would normally type:
...
@@ -72,7 +74,7 @@ This is what you would normally type:
.. If you modify this code, also change :
.. If you modify this code, also change :
.. theano/tests/test_tutorial.py:T_graphstructures.test_graphstructures_1
.. theano/tests/test_tutorial.py:T_graphstructures.test_graphstructures_1
..
code-block:: python
..
testcode::
# create 3 Variables with owner = None
# create 3 Variables with owner = None
x = T.matrix('x')
x = T.matrix('x')
...
@@ -91,7 +93,7 @@ This is what you would type to build the graph explicitly:
...
@@ -91,7 +93,7 @@ This is what you would type to build the graph explicitly:
.. If you modify this code, also change :
.. If you modify this code, also change :
.. theano/tests/test_tutorial.py:T_graphstructures.test_graphstructures_1
.. theano/tests/test_tutorial.py:T_graphstructures.test_graphstructures_1
..
code-block:: python
..
testcode::
from theano.tensor import add, mul, Apply, Variable, TensorType
from theano.tensor import add, mul, Apply, Variable, TensorType
...
@@ -153,13 +155,13 @@ All nodes in the graph must be instances of ``Apply`` or ``Result``, but
...
@@ -153,13 +155,13 @@ All nodes in the graph must be instances of ``Apply`` or ``Result``, but
constraints. For example, the :func:`tensor.add`
constraints. For example, the :func:`tensor.add`
Op instance is written so that:
Op instance is written so that:
..
code-block:: python
..
testcode::
e = dscalar('x') + 1
e =
T.
dscalar('x') + 1
builds the following graph:
builds the following graph:
..
code-block:: python
..
testcode::
node = Apply(op = add,
node = Apply(op = add,
inputs = [Variable(type = dscalar, name = 'x'),
inputs = [Variable(type = dscalar, name = 'x'),
...
@@ -311,6 +313,7 @@ Theano. The symbolic inputs that you operate on are Variables and what
...
@@ -311,6 +313,7 @@ Theano. The symbolic inputs that you operate on are Variables and what
you get from applying various Ops to these inputs are also
you get from applying various Ops to these inputs are also
Variables. For example, when I type
Variables. For example, when I type
>>> import theano
>>> x = theano.tensor.ivector()
>>> x = theano.tensor.ivector()
>>> y = -x
>>> y = -x
...
@@ -399,7 +402,7 @@ In both types of pairs, the second element of the tuple is an index,
...
@@ -399,7 +402,7 @@ In both types of pairs, the second element of the tuple is an index,
such that: ``var.clients[*][0].inputs[index]`` or
such that: ``var.clients[*][0].inputs[index]`` or
``fgraph.outputs[index]`` is that variable.
``fgraph.outputs[index]`` is that variable.
..
code-block:: python
..
testcode::
import theano
import theano
v = theano.tensor.vector()
v = theano.tensor.vector()
...
@@ -427,3 +430,11 @@ such that: ``var.clients[*][0].inputs[index]`` or
...
@@ -427,3 +430,11 @@ such that: ``var.clients[*][0].inputs[index]`` or
client
client
# ('output', 0)
# ('output', 0)
assert f.maker.fgraph.outputs[client[1]] is var
assert f.maker.fgraph.outputs[client[1]] is var
.. testoutput::
Sum{acc_dtype=float64} [@A] '' 1
|Elemwise{add,no_inplace} [@B] '' 0
|TensorConstant{(1,) of 1.0} [@C]
|<TensorType(float64, vector)> [@D]
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论