Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2eb732ed
提交
2eb732ed
authored
7月 18, 2015
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3141 from harlouci/props_corrige2
Props corrige2
上级
3f3bf149
0f2d0a56
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
51 行删除
+11
-51
extra_ops.py
theano/tensor/extra_ops.py
+11
-51
没有找到文件。
theano/tensor/extra_ops.py
浏览文件 @
2eb732ed
...
@@ -64,16 +64,11 @@ cpu_contiguous = CpuContiguous()
...
@@ -64,16 +64,11 @@ cpu_contiguous = CpuContiguous()
class
CumsumOp
(
theano
.
Op
):
class
CumsumOp
(
theano
.
Op
):
# See function cumsum for docstring
# See function cumsum for docstring
__props__
=
(
"axis"
,)
def
__init__
(
self
,
axis
=
None
):
def
__init__
(
self
,
axis
=
None
):
self
.
axis
=
axis
self
.
axis
=
axis
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
axis
==
other
.
axis
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
axis
)
def
make_node
(
self
,
x
):
def
make_node
(
self
,
x
):
x
=
basic
.
as_tensor_variable
(
x
)
x
=
basic
.
as_tensor_variable
(
x
)
out_type
=
x
.
type
()
out_type
=
x
.
type
()
...
@@ -186,16 +181,11 @@ def cumsum(x, axis=None):
...
@@ -186,16 +181,11 @@ def cumsum(x, axis=None):
class
CumprodOp
(
theano
.
Op
):
class
CumprodOp
(
theano
.
Op
):
# See function cumprod for docstring
# See function cumprod for docstring
__props__
=
(
"axis"
,)
def
__init__
(
self
,
axis
=
None
):
def
__init__
(
self
,
axis
=
None
):
self
.
axis
=
axis
self
.
axis
=
axis
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
axis
==
other
.
axis
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
axis
)
def
make_node
(
self
,
x
):
def
make_node
(
self
,
x
):
x
=
basic
.
as_tensor_variable
(
x
)
x
=
basic
.
as_tensor_variable
(
x
)
out_type
=
x
.
type
()
out_type
=
x
.
type
()
...
@@ -310,6 +300,8 @@ def cumprod(x, axis=None):
...
@@ -310,6 +300,8 @@ def cumprod(x, axis=None):
class
DiffOp
(
theano
.
Op
):
class
DiffOp
(
theano
.
Op
):
# See function diff for docstring
# See function diff for docstring
__props__
=
(
"n"
,
"axis"
)
def
__init__
(
self
,
n
=
1
,
axis
=-
1
):
def
__init__
(
self
,
n
=
1
,
axis
=-
1
):
self
.
n
=
n
self
.
n
=
n
self
.
axis
=
axis
self
.
axis
=
axis
...
@@ -318,14 +310,6 @@ class DiffOp(theano.Op):
...
@@ -318,14 +310,6 @@ class DiffOp(theano.Op):
if
n
==
0
:
if
n
==
0
:
self
.
view_map
=
{
0
:
[
0
]}
self
.
view_map
=
{
0
:
[
0
]}
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
n
==
other
.
n
and
self
.
axis
==
other
.
axis
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
n
)
^
hash
(
self
.
axis
)
def
make_node
(
self
,
x
):
def
make_node
(
self
,
x
):
x
=
basic
.
as_tensor_variable
(
x
)
x
=
basic
.
as_tensor_variable
(
x
)
return
theano
.
Apply
(
self
,
[
x
],
[
x
.
type
()])
return
theano
.
Apply
(
self
,
[
x
],
[
x
.
type
()])
...
@@ -391,6 +375,7 @@ class BinCountOp(theano.Op):
...
@@ -391,6 +375,7 @@ class BinCountOp(theano.Op):
compatible_type
=
(
'int8'
,
'int16'
,
'int32'
,
'int64'
,
compatible_type
=
(
'int8'
,
'int16'
,
'int32'
,
'int64'
,
'uint8'
,
'uint16'
,
'uint32'
,
'uint64'
)
'uint8'
,
'uint16'
,
'uint32'
,
'uint64'
)
"""Tuple of all compatible dtype for the parameter of this op."""
"""Tuple of all compatible dtype for the parameter of this op."""
__props__
=
(
"minlength"
,)
def
__init__
(
self
,
minlength
=
None
):
def
__init__
(
self
,
minlength
=
None
):
self
.
minlength
=
minlength
self
.
minlength
=
minlength
...
@@ -401,13 +386,6 @@ class BinCountOp(theano.Op):
...
@@ -401,13 +386,6 @@ class BinCountOp(theano.Op):
"BinCountOp with minlength attribute"
"BinCountOp with minlength attribute"
" requires NumPy 1.6 or higher."
)
" requires NumPy 1.6 or higher."
)
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
minlength
==
other
.
minlength
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
minlength
)
def
make_node
(
self
,
x
,
weights
):
def
make_node
(
self
,
x
,
weights
):
warnings
.
warn
((
warnings
.
warn
((
"Tile op is deprecated, use tile function instead."
),
"Tile op is deprecated, use tile function instead."
),
...
@@ -585,17 +563,11 @@ def compress(condition, x, axis=None):
...
@@ -585,17 +563,11 @@ def compress(condition, x, axis=None):
class
RepeatOp
(
theano
.
Op
):
class
RepeatOp
(
theano
.
Op
):
# See the repeat function for docstring
# See the repeat function for docstring
__props__
=
(
"axis"
,)
def
__init__
(
self
,
axis
=
None
):
def
__init__
(
self
,
axis
=
None
):
self
.
axis
=
axis
self
.
axis
=
axis
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
axis
==
other
.
axis
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
^
hash
(
self
.
axis
)
def
make_node
(
self
,
x
,
repeats
):
def
make_node
(
self
,
x
,
repeats
):
x
=
basic
.
as_tensor_variable
(
x
)
x
=
basic
.
as_tensor_variable
(
x
)
repeats
=
basic
.
as_tensor_variable
(
repeats
)
repeats
=
basic
.
as_tensor_variable
(
repeats
)
...
@@ -764,11 +736,7 @@ def repeat(x, repeats, axis=None):
...
@@ -764,11 +736,7 @@ def repeat(x, repeats, axis=None):
class
Bartlett
(
gof
.
Op
):
class
Bartlett
(
gof
.
Op
):
# See function bartlett for docstring
# See function bartlett for docstring
def
__eq__
(
self
,
other
):
__props__
=
()
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
__class__
.
__name__
return
self
.
__class__
.
__name__
...
@@ -826,11 +794,7 @@ def bartlett(M):
...
@@ -826,11 +794,7 @@ def bartlett(M):
class
FillDiagonal
(
gof
.
Op
):
class
FillDiagonal
(
gof
.
Op
):
# See function fill_diagonal for docstring
# See function fill_diagonal for docstring
def
__eq__
(
self
,
other
):
__props__
=
()
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
__class__
.
__name__
return
self
.
__class__
.
__name__
...
@@ -914,11 +878,7 @@ def fill_diagonal(a, val):
...
@@ -914,11 +878,7 @@ def fill_diagonal(a, val):
class
FillDiagonalOffset
(
gof
.
Op
):
class
FillDiagonalOffset
(
gof
.
Op
):
# See function fill_diagonal_offset for docstring
# See function fill_diagonal_offset for docstring
def
__eq__
(
self
,
other
):
__props__
=
()
return
type
(
self
)
==
type
(
other
)
def
__hash__
(
self
):
return
hash
(
type
(
self
))
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
__class__
.
__name__
return
self
.
__class__
.
__name__
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论