Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a2fb4f62
提交
a2fb4f62
authored
2月 15, 2016
作者:
AdeB
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix local_bitwidth and python_int_bitwidth imports
上级
5c4aafee
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
11 行增加
和
15 行删除
+11
-15
test_pfunc.py
theano/compile/tests/test_pfunc.py
+1
-1
test_shared.py
theano/compile/tests/test_shared.py
+1
-1
__init__.py
theano/gof/__init__.py
+0
-4
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+1
-1
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+1
-1
extra_ops.py
theano/tensor/extra_ops.py
+3
-3
test_basic.py
theano/tensor/tests/test_basic.py
+1
-1
test_extra_ops.py
theano/tensor/tests/test_extra_ops.py
+3
-3
没有找到文件。
theano/compile/tests/test_pfunc.py
浏览文件 @
a2fb4f62
...
@@ -549,7 +549,7 @@ class Test_pfunc(unittest.TestCase):
...
@@ -549,7 +549,7 @@ class Test_pfunc(unittest.TestCase):
def
test_default_updates_input
(
self
):
def
test_default_updates_input
(
self
):
x
=
shared
(
0
)
x
=
shared
(
0
)
y
=
shared
(
1
)
y
=
shared
(
1
)
if
theano
.
gof
.
python_int_bitwidth
()
==
32
:
if
theano
.
configdefaults
.
python_int_bitwidth
()
==
32
:
a
=
iscalar
(
'a'
)
a
=
iscalar
(
'a'
)
else
:
else
:
a
=
lscalar
(
'a'
)
a
=
lscalar
(
'a'
)
...
...
theano/compile/tests/test_shared.py
浏览文件 @
a2fb4f62
...
@@ -18,7 +18,7 @@ class Test_SharedVariable(unittest.TestCase):
...
@@ -18,7 +18,7 @@ class Test_SharedVariable(unittest.TestCase):
assert
shared
(
7
,
dtype
=
'float64'
)
.
type
==
Scalar
(
'float64'
)
assert
shared
(
7
,
dtype
=
'float64'
)
.
type
==
Scalar
(
'float64'
)
else
:
else
:
if
theano
.
gof
.
python_int_bitwidth
()
==
32
:
if
theano
.
configdefaults
.
python_int_bitwidth
()
==
32
:
assert
shared
(
7
)
.
type
==
theano
.
tensor
.
iscalar
,
shared
(
7
)
.
type
assert
shared
(
7
)
.
type
==
theano
.
tensor
.
iscalar
,
shared
(
7
)
.
type
else
:
else
:
assert
shared
(
7
)
.
type
==
theano
.
tensor
.
lscalar
,
shared
(
7
)
.
type
assert
shared
(
7
)
.
type
==
theano
.
tensor
.
lscalar
,
shared
(
7
)
.
type
...
...
theano/gof/__init__.py
浏览文件 @
a2fb4f62
...
@@ -38,10 +38,6 @@ e-mail thread "What is gof?".
...
@@ -38,10 +38,6 @@ e-mail thread "What is gof?".
from
theano.gof.cc
import
\
from
theano.gof.cc
import
\
CLinker
,
OpWiseCLinker
,
DualLinker
,
HideC
CLinker
,
OpWiseCLinker
,
DualLinker
,
HideC
# Also adds config vars
from
theano.gof.compiledir
import
\
local_bitwidth
,
python_int_bitwidth
from
theano.gof.fg
import
\
from
theano.gof.fg
import
\
CachedConstantError
,
InconsistencyError
,
MissingInputError
,
FunctionGraph
CachedConstantError
,
InconsistencyError
,
MissingInputError
,
FunctionGraph
...
...
theano/sandbox/cuda/basic_ops.py
浏览文件 @
a2fb4f62
...
@@ -3008,7 +3008,7 @@ class GpuAdvancedIncSubtensor1_dev20(GpuAdvancedIncSubtensor1):
...
@@ -3008,7 +3008,7 @@ class GpuAdvancedIncSubtensor1_dev20(GpuAdvancedIncSubtensor1):
32
:
tensor
.
basic
.
_convert_to_int32
,
32
:
tensor
.
basic
.
_convert_to_int32
,
64
:
tensor
.
basic
.
_convert_to_int64
64
:
tensor
.
basic
.
_convert_to_int64
}
}
intwidth
=
theano
.
gof
.
compiledir
.
python_int_bitwidth
()
intwidth
=
theano
.
configdefaults
.
python_int_bitwidth
()
ilist_
=
convert_map
[
intwidth
](
ilist_
)
ilist_
=
convert_map
[
intwidth
](
ilist_
)
assert
x_
.
type
.
dtype
==
y_
.
type
.
dtype
assert
x_
.
type
.
dtype
==
y_
.
type
.
dtype
...
...
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
a2fb4f62
...
@@ -10,7 +10,7 @@ import numpy
...
@@ -10,7 +10,7 @@ import numpy
from
theano
import
config
from
theano
import
config
from
theano.compat
import
decode
,
decode_iter
from
theano.compat
import
decode
,
decode_iter
from
theano.
gof
import
local_bitwidth
from
theano.
configdefaults
import
local_bitwidth
from
theano.gof.utils
import
hash_from_file
from
theano.gof.utils
import
hash_from_file
from
theano.gof.cmodule
import
(
std_libs
,
std_lib_dirs
,
from
theano.gof.cmodule
import
(
std_libs
,
std_lib_dirs
,
std_include_dirs
,
dlimport
,
std_include_dirs
,
dlimport
,
...
...
theano/tensor/extra_ops.py
浏览文件 @
a2fb4f62
...
@@ -416,12 +416,12 @@ class BinCountOp(theano.Op):
...
@@ -416,12 +416,12 @@ class BinCountOp(theano.Op):
# Some dtypes are not supported by numpy's implementation of bincount.
# Some dtypes are not supported by numpy's implementation of bincount.
# Until another one is available, we should fail at graph construction
# Until another one is available, we should fail at graph construction
# time, not wait for execution.
# time, not wait for execution.
int_bitwidth
=
theano
.
gof
.
python_int_bitwidth
()
int_bitwidth
=
theano
.
configdefaults
.
python_int_bitwidth
()
if
int_bitwidth
==
64
:
if
int_bitwidth
==
64
:
numpy_unsupported_dtypes
=
(
'uint64'
,)
numpy_unsupported_dtypes
=
(
'uint64'
,)
if
int_bitwidth
==
32
:
if
int_bitwidth
==
32
:
numpy_unsupported_dtypes
=
(
'uint32'
,
'int64'
,
'uint64'
)
numpy_unsupported_dtypes
=
(
'uint32'
,
'int64'
,
'uint64'
)
intp_bitwidth
=
theano
.
gof
.
local_bitwidth
()
intp_bitwidth
=
theano
.
configdefaults
.
local_bitwidth
()
if
intp_bitwidth
==
32
:
if
intp_bitwidth
==
32
:
out_type
=
basic
.
ivector
()
out_type
=
basic
.
ivector
()
elif
intp_bitwidth
==
64
:
elif
intp_bitwidth
==
64
:
...
@@ -598,7 +598,7 @@ class RepeatOp(theano.Op):
...
@@ -598,7 +598,7 @@ class RepeatOp(theano.Op):
# Some dtypes are not supported by numpy's implementation of repeat.
# Some dtypes are not supported by numpy's implementation of repeat.
# Until another one is available, we should fail at graph construction
# Until another one is available, we should fail at graph construction
# time, not wait for execution.
# time, not wait for execution.
ptr_bitwidth
=
theano
.
gof
.
local_bitwidth
()
ptr_bitwidth
=
theano
.
configdefaults
.
local_bitwidth
()
if
ptr_bitwidth
==
64
:
if
ptr_bitwidth
==
64
:
numpy_unsupported_dtypes
=
(
'uint64'
,)
numpy_unsupported_dtypes
=
(
'uint64'
,)
if
ptr_bitwidth
==
32
:
if
ptr_bitwidth
==
32
:
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
a2fb4f62
...
@@ -6672,7 +6672,7 @@ class test_arithmetic_cast(unittest.TestCase):
...
@@ -6672,7 +6672,7 @@ class test_arithmetic_cast(unittest.TestCase):
class
T_long_tensor
(
unittest
.
TestCase
):
class
T_long_tensor
(
unittest
.
TestCase
):
def
test_fit_int64
(
self
):
def
test_fit_int64
(
self
):
for
exp
in
xrange
(
gof
.
python_int_bitwidth
()):
for
exp
in
xrange
(
theano
.
configdefaults
.
python_int_bitwidth
()):
val
=
L
(
2
**
exp
-
1
)
val
=
L
(
2
**
exp
-
1
)
scalar_ct
=
constant
(
val
)
scalar_ct
=
constant
(
val
)
...
...
theano/tensor/tests/test_extra_ops.py
浏览文件 @
a2fb4f62
...
@@ -175,7 +175,7 @@ class TestBinCountOp(utt.InferShapeTester):
...
@@ -175,7 +175,7 @@ class TestBinCountOp(utt.InferShapeTester):
'uint8'
,
'uint16'
,
'uint32'
,
'uint64'
):
'uint8'
,
'uint16'
,
'uint32'
,
'uint64'
):
# uint64 always fails
# uint64 always fails
# int64 and uint32 also fail if python int are 32-bit
# int64 and uint32 also fail if python int are 32-bit
int_bitwidth
=
theano
.
gof
.
python_int_bitwidth
()
int_bitwidth
=
theano
.
configdefaults
.
python_int_bitwidth
()
if
int_bitwidth
==
64
:
if
int_bitwidth
==
64
:
numpy_unsupported_dtypes
=
(
'uint64'
,)
numpy_unsupported_dtypes
=
(
'uint64'
,)
if
int_bitwidth
==
32
:
if
int_bitwidth
==
32
:
...
@@ -208,7 +208,7 @@ class TestBinCountOp(utt.InferShapeTester):
...
@@ -208,7 +208,7 @@ class TestBinCountOp(utt.InferShapeTester):
for
dtype
in
tensor
.
discrete_dtypes
:
for
dtype
in
tensor
.
discrete_dtypes
:
# uint64 always fails
# uint64 always fails
# int64 and uint32 also fail if python int are 32-bit
# int64 and uint32 also fail if python int are 32-bit
int_bitwidth
=
theano
.
gof
.
python_int_bitwidth
()
int_bitwidth
=
theano
.
configdefaults
.
python_int_bitwidth
()
if
int_bitwidth
==
64
:
if
int_bitwidth
==
64
:
numpy_unsupported_dtypes
=
(
'uint64'
,)
numpy_unsupported_dtypes
=
(
'uint64'
,)
if
int_bitwidth
==
32
:
if
int_bitwidth
==
32
:
...
@@ -408,7 +408,7 @@ class TestRepeatOp(utt.InferShapeTester):
...
@@ -408,7 +408,7 @@ class TestRepeatOp(utt.InferShapeTester):
self
.
op
=
RepeatOp
()
self
.
op
=
RepeatOp
()
# uint64 always fails
# uint64 always fails
# int64 and uint32 also fail if python int are 32-bit
# int64 and uint32 also fail if python int are 32-bit
ptr_bitwidth
=
theano
.
gof
.
local_bitwidth
()
ptr_bitwidth
=
theano
.
configdefaults
.
local_bitwidth
()
if
ptr_bitwidth
==
64
:
if
ptr_bitwidth
==
64
:
self
.
numpy_unsupported_dtypes
=
(
'uint64'
,)
self
.
numpy_unsupported_dtypes
=
(
'uint64'
,)
if
ptr_bitwidth
==
32
:
if
ptr_bitwidth
==
32
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论