Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5684663b
提交
5684663b
authored
6月 26, 2015
作者:
Iban Harlouchet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
One more test + some doc
上级
fb891477
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
1 行删除
+25
-1
basic.txt
doc/library/tensor/basic.txt
+10
-0
basic.py
theano/tensor/basic.py
+1
-1
test_basic.py
theano/tensor/tests/test_basic.py
+14
-0
没有找到文件。
doc/library/tensor/basic.txt
浏览文件 @
5684663b
...
@@ -1643,6 +1643,16 @@ Linear Algebra
...
@@ -1643,6 +1643,16 @@ Linear Algebra
:note: See :func:`tensordot` and :func:`batched_dot` for
:note: See :func:`tensordot` and :func:`batched_dot` for
supplementary documentation.
supplementary documentation.
.. class:: _nd_grid(object)
Create a dense n-dimensional 'meshgrid' with equally spaced points.
Used to create the instance ''mgrid'' and ''ogrid'' which act similarly
to their numpy equivalents.
:param sparse: boolean, optional, default=True. Specifying False leads to
the equivalent of numpy's mgrid functionality. Specifying
True leads to the equivalent of ogrid.
Gradient / Differentiation
Gradient / Differentiation
...
...
theano/tensor/basic.py
浏览文件 @
5684663b
...
@@ -4644,7 +4644,7 @@ class _nd_grid(object):
...
@@ -4644,7 +4644,7 @@ class _nd_grid(object):
raise
NotImplementedError
(
"Not implemented for slices "
raise
NotImplementedError
(
"Not implemented for slices "
"whose step is complex"
)
"whose step is complex"
)
ranges
=
[
arange
(
sl
.
start
or
0
,
ranges
=
[
arange
(
sl
.
start
or
0
,
sl
.
stop
or
None
,
sl
.
stop
,
sl
.
step
or
1
)
for
sl
in
args
[
0
]]
sl
.
step
or
1
)
for
sl
in
args
[
0
]]
shapes
=
[
tuple
([
1
]
*
j
+
[
r
.
shape
[
0
]]
+
[
1
]
*
(
ndim
-
1
-
j
))
shapes
=
[
tuple
([
1
]
*
j
+
[
r
.
shape
[
0
]]
+
[
1
]
*
(
ndim
-
1
-
j
))
for
j
,
r
in
enumerate
(
ranges
)]
for
j
,
r
in
enumerate
(
ranges
)]
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
5684663b
...
@@ -5516,6 +5516,20 @@ class TestNdGrid(unittest.TestCase):
...
@@ -5516,6 +5516,20 @@ class TestNdGrid(unittest.TestCase):
for
ng
,
tg
in
zip
(
n
,
t
):
for
ng
,
tg
in
zip
(
n
,
t
):
assert_array_equal
(
ng
,
tg
)
assert_array_equal
(
ng
,
tg
)
def
test_ogrid_theano_variable_numpy_equiv
(
self
):
nfogrid
=
numpy
.
ogrid
[
0
:
1
:
.
1
,
1
:
10
:
1.
,
10
:
100
:
10.
]
niogrid
=
numpy
.
ogrid
[
0
:
2
:
1
,
1
:
10
:
1
,
10
:
100
:
10
]
i
,
j
,
k
=
dscalars
(
'i'
,
'j'
,
'k'
)
l
,
m
,
n
=
iscalars
(
'l'
,
'm'
,
'n'
)
tfogrid
=
ogrid
[
i
:
1
:
.
1
,
1
:
j
:
1.
,
10
:
100
:
k
]
tiogrid
=
ogrid
[
l
:
2
:
1
,
1
:
m
:
1
,
10
:
100
:
n
]
ff
=
theano
.
function
([
i
,
j
,
k
],
tfogrid
)
fi
=
theano
.
function
([
l
,
m
,
n
],
tiogrid
)
for
n
,
t
in
zip
((
nfogrid
,
niogrid
),
(
ff
(
0
,
10
,
10.
),
fi
(
0
,
10
,
10
))):
for
ng
,
tg
in
zip
(
n
,
t
):
assert_array_equal
(
ng
,
tg
)
class
TestInversePermutation
(
unittest
.
TestCase
):
class
TestInversePermutation
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
utt
.
seed_rng
()
utt
.
seed_rng
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论