Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
70de3a56
提交
70de3a56
authored
11月 19, 2010
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove 'import *' in tutorial code and tests.
上级
b831de6d
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
11 行增加
和
13 行删除
+11
-13
graphstructures.txt
doc/extending/graphstructures.txt
+4
-6
test_tutorial.py
theano/tests/test_tutorial.py
+7
-7
没有找到文件。
doc/extending/graphstructures.txt
浏览文件 @
70de3a56
...
@@ -74,12 +74,10 @@ This is what you would normally type:
...
@@ -74,12 +74,10 @@ This is what you would normally type:
.. code-block:: python
.. code-block:: python
from theano.tensor import *
# create 3 Variables with owner = None
# create 3 Variables with owner = None
x = matrix('x')
x =
T.
matrix('x')
y = matrix('y')
y =
T.
matrix('y')
z = matrix('z')
z =
T.
matrix('z')
# create 2 Variables (one for 'e', one intermediate for y*z)
# create 2 Variables (one for 'e', one intermediate for y*z)
# create 2 Apply instances (one for '+', one for '*')
# create 2 Apply instances (one for '+', one for '*')
...
@@ -95,7 +93,7 @@ This is what you would type to build the graph explicitly:
...
@@ -95,7 +93,7 @@ This is what you would type to build the graph explicitly:
.. code-block:: python
.. code-block:: python
from theano.tensor import
*
from theano.tensor import
add, mul, Apply, Variable, TensorType
# Instantiate a type that represents a matrix of doubles
# Instantiate a type that represents a matrix of doubles
float64_matrix = TensorType(dtype = 'float64', # double
float64_matrix = TensorType(dtype = 'float64', # double
...
...
theano/tests/test_tutorial.py
浏览文件 @
70de3a56
...
@@ -903,20 +903,20 @@ class T_graphstructures(unittest.TestCase):
...
@@ -903,20 +903,20 @@ class T_graphstructures(unittest.TestCase):
def
test_graphstructures_1
(
self
):
def
test_graphstructures_1
(
self
):
from
theano.tensor
import
*
x
=
T
.
dmatrix
(
'x'
)
y
=
T
.
dmatrix
(
'y'
)
x
=
dmatrix
(
'x'
)
y
=
dmatrix
(
'y'
)
z
=
x
+
y
z
=
x
+
y
x
=
matrix
(
'x'
)
x
=
T
.
matrix
(
'x'
)
y
=
matrix
(
'y'
)
y
=
T
.
matrix
(
'y'
)
z
=
matrix
(
'z'
)
z
=
T
.
matrix
(
'z'
)
# create 2 Variables (one for 'e', one intermediate for y*z)
# create 2 Variables (one for 'e', one intermediate for y*z)
# create 2 Apply instances (one for '+', one for '*')
# create 2 Apply instances (one for '+', one for '*')
e
=
x
+
y
*
z
e
=
x
+
y
*
z
from
theano.tensor
import
add
,
mul
,
Apply
,
Variable
,
TensorType
# Instantiate a type that represents a matrix of doubles
# Instantiate a type that represents a matrix of doubles
float64_matrix
=
TensorType
(
dtype
=
'float64'
,
# double
float64_matrix
=
TensorType
(
dtype
=
'float64'
,
# double
broadcastable
=
(
False
,
False
))
# matrix
broadcastable
=
(
False
,
False
))
# matrix
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论