Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
55596d1b
提交
55596d1b
authored
12月 02, 2016
作者:
Benjamin Scellier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
various changes
上级
4840a1f6
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
4 行增加
和
62 行删除
+4
-62
setup.py
setup.py
+0
-1
nlinalg.py
theano/tensor/nlinalg.py
+2
-6
test_basic.py
theano/tensor/tests/test_basic.py
+0
-27
test_opt.py
theano/tensor/tests/test_opt.py
+0
-15
utils.py
theano/tensor/utils.py
+1
-3
var.py
theano/tensor/var.py
+1
-10
没有找到文件。
setup.py
浏览文件 @
55596d1b
...
@@ -161,7 +161,6 @@ def do_setup():
...
@@ -161,7 +161,6 @@ def do_setup():
license
=
LICENSE
,
license
=
LICENSE
,
platforms
=
PLATFORMS
,
platforms
=
PLATFORMS
,
packages
=
find_packages
(),
packages
=
find_packages
(),
# 1.7.0 give too much warning related to numpy.diagonal.
install_requires
=
[
'numpy>=1.9.1'
,
'scipy>=0.14'
,
'six>=1.9.0'
],
install_requires
=
[
'numpy>=1.9.1'
,
'scipy>=0.14'
,
'six>=1.9.0'
],
# pygments is a dependency for Sphinx code highlight
# pygments is a dependency for Sphinx code highlight
extras_require
=
{
extras_require
=
{
...
...
theano/tensor/nlinalg.py
浏览文件 @
55596d1b
...
@@ -557,14 +557,10 @@ def qr(a, mode="reduced"):
...
@@ -557,14 +557,10 @@ def qr(a, mode="reduced"):
'raw'
'raw'
returns h, tau with dimensions (N, M), (K,)
returns h, tau with dimensions (N, M), (K,)
The options 'reduced', 'complete', and 'raw' are new in numpy
Note that array h returned in 'raw' mode is
1.8, see the notes for more information. The default is
'reduced' and to maintain backward compatibility with earlier
versions of numpy it can be
omitted. Note that array h returned in 'raw' mode is
transposed for calling Fortran.
transposed for calling Fortran.
Default mode is 'reduced'
which is also default for numpy 1.8
Default mode is 'reduced'
Returns
Returns
-------
-------
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
55596d1b
...
@@ -6797,33 +6797,6 @@ class T_long_tensor(unittest.TestCase):
...
@@ -6797,33 +6797,6 @@ class T_long_tensor(unittest.TestCase):
assert
numpy
.
all
(
matrix_ct
.
value
==
val
)
assert
numpy
.
all
(
matrix_ct
.
value
==
val
)
def
test_too_big
(
self
):
def
test_too_big
(
self
):
val
=
L
(
2
**
63
)
# NumPy 1.7 this will raise an exception
# NumPy 1.7.1 this will work
try
:
cst
=
constant
(
val
)
assert
cst
.
value
==
val
assert
cst
.
dtype
==
"uint64"
except
OverflowError
:
pass
try
:
cst
=
constant
([
val
,
val
])
assert
cst
.
value
[
0
]
==
val
assert
cst
.
value
[
1
]
==
val
assert
cst
.
value
.
size
==
2
assert
cst
.
dtype
==
"uint64"
except
TypeError
:
pass
try
:
cst
=
constant
([[
val
,
val
]])
assert
cst
.
value
[
0
,
0
]
==
val
assert
cst
.
value
[
0
,
1
]
==
val
assert
cst
.
value
.
size
==
2
assert
cst
.
dtype
==
"uint64"
except
TypeError
:
pass
val
=
L
(
2
**
64
)
val
=
L
(
2
**
64
)
# This fail for all NumPy version.
# This fail for all NumPy version.
self
.
assertRaises
(
Exception
,
constant
,
val
)
self
.
assertRaises
(
Exception
,
constant
,
val
)
...
...
theano/tensor/tests/test_opt.py
浏览文件 @
55596d1b
...
@@ -3003,9 +3003,6 @@ class Test_alloc_zero(unittest.TestCase):
...
@@ -3003,9 +3003,6 @@ class Test_alloc_zero(unittest.TestCase):
for
n
in
f
.
maker
.
fgraph
.
toposort
()])
for
n
in
f
.
maker
.
fgraph
.
toposort
()])
def
test_advancedincsubtensor_allocs0
(
self
):
def
test_advancedincsubtensor_allocs0
(
self
):
if
tensor
.
inplace_increment
is
None
:
raise
SkipTest
(
'NumPy version >= 1.8 not available'
)
x
=
tensor
.
matrix
()
x
=
tensor
.
matrix
()
y
=
tensor
.
matrix
()
y
=
tensor
.
matrix
()
y0
=
tensor
.
zeros_like
(
y
)
y0
=
tensor
.
zeros_like
(
y
)
...
@@ -3015,9 +3012,6 @@ class Test_alloc_zero(unittest.TestCase):
...
@@ -3015,9 +3012,6 @@ class Test_alloc_zero(unittest.TestCase):
for
n
in
f
.
maker
.
fgraph
.
toposort
()])
for
n
in
f
.
maker
.
fgraph
.
toposort
()])
def
test_advancedincsubtensor_allocs0t
(
self
):
def
test_advancedincsubtensor_allocs0t
(
self
):
if
tensor
.
inplace_increment
is
None
:
raise
SkipTest
(
'NumPy version >= 1.8 not available'
)
x
=
tensor
.
matrix
()
x
=
tensor
.
matrix
()
y
=
tensor
.
matrix
()
y
=
tensor
.
matrix
()
y0
=
tensor
.
zeros_like
(
y
)
y0
=
tensor
.
zeros_like
(
y
)
...
@@ -3027,9 +3021,6 @@ class Test_alloc_zero(unittest.TestCase):
...
@@ -3027,9 +3021,6 @@ class Test_alloc_zero(unittest.TestCase):
for
n
in
f
.
maker
.
fgraph
.
toposort
()])
for
n
in
f
.
maker
.
fgraph
.
toposort
()])
def
test_advancedincsubtensor_allocs1
(
self
):
def
test_advancedincsubtensor_allocs1
(
self
):
if
tensor
.
inplace_increment
is
None
:
raise
SkipTest
(
'NumPy version >= 1.8 not available'
)
x
=
tensor
.
matrix
()
x
=
tensor
.
matrix
()
y0
=
tensor
.
constant
(
numpy
.
asarray
(
numpy
.
zeros_like
((
2
,
2
)),
y0
=
tensor
.
constant
(
numpy
.
asarray
(
numpy
.
zeros_like
((
2
,
2
)),
dtype
=
config
.
floatX
))
dtype
=
config
.
floatX
))
...
@@ -3856,9 +3847,6 @@ class Test_local_useless_inc_subtensor_alloc(unittest.TestCase):
...
@@ -3856,9 +3847,6 @@ class Test_local_useless_inc_subtensor_alloc(unittest.TestCase):
self
.
mode
=
compile
.
mode
.
get_mode
(
mode
)
self
.
mode
=
compile
.
mode
.
get_mode
(
mode
)
def
test_advanced_inc_subtensor
(
self
):
def
test_advanced_inc_subtensor
(
self
):
if
tensor
.
inplace_increment
is
None
:
raise
SkipTest
(
'NumPy version >= 1.8 not available'
)
x
=
tensor
.
vector
(
'x'
)
x
=
tensor
.
vector
(
'x'
)
y
=
tensor
.
scalar
(
'y'
)
y
=
tensor
.
scalar
(
'y'
)
i
=
tensor
.
matrix
(
'i'
,
dtype
=
'int64'
)
i
=
tensor
.
matrix
(
'i'
,
dtype
=
'int64'
)
...
@@ -3889,9 +3877,6 @@ class Test_local_useless_inc_subtensor_alloc(unittest.TestCase):
...
@@ -3889,9 +3877,6 @@ class Test_local_useless_inc_subtensor_alloc(unittest.TestCase):
self
.
assertTrue
(
check_stack_trace
(
f2
,
ops_to_check
=
tensor
.
AdvancedIncSubtensor
))
self
.
assertTrue
(
check_stack_trace
(
f2
,
ops_to_check
=
tensor
.
AdvancedIncSubtensor
))
def
test_advanced_inc_subtensor1
(
self
):
def
test_advanced_inc_subtensor1
(
self
):
if
tensor
.
inplace_increment
is
None
:
raise
SkipTest
(
'NumPy version >= 1.8 not available'
)
x
=
tensor
.
vector
(
'x'
)
x
=
tensor
.
vector
(
'x'
)
y
=
tensor
.
scalar
(
'y'
)
y
=
tensor
.
scalar
(
'y'
)
i
=
tensor
.
vector
(
'i'
,
dtype
=
'int64'
)
i
=
tensor
.
vector
(
'i'
,
dtype
=
'int64'
)
...
...
theano/tensor/utils.py
浏览文件 @
55596d1b
...
@@ -22,9 +22,7 @@ def hash_from_ndarray(data):
...
@@ -22,9 +22,7 @@ def hash_from_ndarray(data):
# python hash are not strong, so I always use md5 in order not to have a
# python hash are not strong, so I always use md5 in order not to have a
# too long hash, I call it again on the concatenation of all parts.
# too long hash, I call it again on the concatenation of all parts.
if
not
data
.
flags
[
"C_CONTIGUOUS"
]:
if
not
data
.
flags
[
"C_CONTIGUOUS"
]:
# Version 1.7.1 and previous of NumPy allowed calling
# hash_from_code needs a C-contiguous array.
# hash_from_code on an F-contiguous array, but more recent
# versions need a C-contiguous one.
data
=
numpy
.
ascontiguousarray
(
data
)
data
=
numpy
.
ascontiguousarray
(
data
)
return
hash_from_code
(
hash_from_code
(
data
)
+
return
hash_from_code
(
hash_from_code
(
data
)
+
hash_from_code
(
str
(
data
.
shape
))
+
hash_from_code
(
str
(
data
.
shape
))
+
...
...
theano/tensor/var.py
浏览文件 @
55596d1b
...
@@ -88,16 +88,7 @@ class _tensor_py_operators(object):
...
@@ -88,16 +88,7 @@ class _tensor_py_operators(object):
return
True
return
True
else
:
else
:
raise
TypeError
(
raise
TypeError
(
"Variables do not support boolean operations. This "
"Variables do not support boolean operations."
"can happen if you do a logical operation (<, <=, >, <=, "
"==, !=) between a numpy.ndarray and a Theano tensor"
"variable. Due to NumPy implementation before NumPy 1.8, "
"we cannot make the Python syntax work when the ndarray "
"is on the left, and this results in this error. To work "
"around that, either call "
"theano.tensor.{lt,le,eq,ne,gt,ge}(ndarray, tensor), or "
"use the Python syntax with the Theano tensor on the "
"left. Or update to NumPy 1.8 or above."
)
)
# BITWISE
# BITWISE
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论