Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4aad70d8
提交
4aad70d8
authored
8月 29, 2016
作者:
Frédéric Bastien
提交者:
GitHub
8月 29, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4888 from nke001/ccw4601_cpy
ccw4601 remove name from reshape op
上级
aaed1835
10d7e4f0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
8 行删除
+5
-8
opt.py
theano/gpuarray/opt.py
+2
-5
basic.py
theano/tensor/basic.py
+3
-3
没有找到文件。
theano/gpuarray/opt.py
浏览文件 @
4aad70d8
...
...
@@ -643,10 +643,7 @@ def local_gpua_contiguous(op, context_name, inputs, outputs):
@op_lifter
([
tensor
.
Reshape
])
@register_opt2
([
tensor
.
Reshape
],
'fast_compile'
)
def
local_gpua_reshape
(
op
,
context_name
,
inputs
,
outputs
):
name
=
op
.
name
if
name
:
name
=
'Gpu'
+
name
res
=
GpuReshape
(
op
.
ndim
,
op
.
name
)
res
=
GpuReshape
(
op
.
ndim
)
return
res
...
...
@@ -665,7 +662,7 @@ def local_gpua_flatten(op, context_name, inputs, outputs):
if
op
.
outdim
!=
1
:
shp
=
[
inputs
[
0
]
.
shape
[
i
]
for
i
in
range
(
op
.
outdim
-
1
)]
shp
+=
[
-
1
]
res
=
GpuReshape
(
op
.
outdim
,
None
)
res
=
GpuReshape
(
op
.
outdim
)
o
=
res
(
inputs
[
0
],
theano
.
tensor
.
as_tensor_variable
(
shp
))
return
o
...
...
theano/tensor/basic.py
浏览文件 @
4aad70d8
...
...
@@ -4440,7 +4440,7 @@ class Reshape(Op):
def
__init__
(
self
,
ndim
,
name
=
None
):
self
.
ndim
=
ndim
self
.
name
=
name
assert
name
is
None
,
'name attribute for Reshape has been deprecated'
def
__str__
(
self
):
return
'
%
s{
%
s}'
%
(
self
.
__class__
.
__name__
,
self
.
ndim
)
...
...
@@ -4616,7 +4616,7 @@ class Reshape(Op):
return
Op
.
c_code
(
self
,
node
,
name
,
inputs
,
outputs
,
sub
)
def
reshape
(
x
,
newshape
,
ndim
=
None
,
name
=
None
):
def
reshape
(
x
,
newshape
,
ndim
=
None
):
if
ndim
is
None
:
newshape
=
as_tensor_variable
(
newshape
)
if
newshape
.
ndim
!=
1
:
...
...
@@ -4632,7 +4632,7 @@ def reshape(x, newshape, ndim=None, name=None):
"to know what the number of dimensions of the reshaped "
"variable will be. You can provide the 'ndim' keyword "
"argument to 'reshape' to avoid this problem."
%
newshape
)
op
=
Reshape
(
ndim
,
name
)
op
=
Reshape
(
ndim
)
rval
=
op
(
x
,
newshape
)
return
rval
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论