Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a6fead02
提交
a6fead02
authored
3月 06, 2013
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Pep8 / Pyflakes
上级
872c8166
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
11 行增加
和
14 行删除
+11
-14
__init__.py
theano/gof/__init__.py
+0
-1
cmodule.py
theano/gof/cmodule.py
+6
-6
utils.py
theano/gof/utils.py
+0
-0
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+0
-3
extra_ops.py
theano/tensor/extra_ops.py
+1
-1
test_extra_ops.py
theano/tensor/tests/test_extra_ops.py
+4
-3
没有找到文件。
theano/gof/__init__.py
浏览文件 @
a6fead02
...
...
@@ -79,4 +79,3 @@ from theano.gof.type import \
from
theano.gof.utils
import
\
object2
,
MethodNotDefined
theano/gof/cmodule.py
浏览文件 @
a6fead02
...
...
@@ -8,7 +8,6 @@ import os
import
shutil
import
stat
import
StringIO
import
struct
import
subprocess
import
sys
import
tempfile
...
...
@@ -153,14 +152,14 @@ static struct PyModuleDef moduledef = {{
}};
"""
.
format
(
name
=
self
.
name
)
print
>>
stream
,
"PyMODINIT_FUNC PyInit_
%
s(void) {"
%
self
.
name
for
b
in
self
.
init_blocks
:
print
>>
stream
,
' '
,
b
for
b
lock
in
self
.
init_blocks
:
print
>>
stream
,
' '
,
b
lock
print
>>
stream
,
" PyObject *m = PyModule_Create(&moduledef);"
print
>>
stream
,
" return m;"
else
:
print
>>
stream
,
"PyMODINIT_FUNC init
%
s(void){"
%
self
.
name
for
b
in
self
.
init_blocks
:
print
>>
stream
,
' '
,
b
for
b
lock
in
self
.
init_blocks
:
print
>>
stream
,
' '
,
b
lock
print
>>
stream
,
' '
,
(
'(void) Py_InitModule("
%
s", MyMethods);'
%
self
.
name
)
print
>>
stream
,
"}"
...
...
@@ -1541,7 +1540,8 @@ class GCC_compiler(object):
lines
=
stdout
+
stderr
return
lines
# The '-' at the end is needed. Otherwise, g++ do not output enough information.
# The '-' at the end is needed. Otherwise, g++ do not output
# enough information.
native_lines
=
get_lines
(
"g++ -march=native -E -v -"
)
_logger
.
info
(
"g++ -march=native selected lines:
%
s"
,
native_lines
)
if
len
(
native_lines
)
!=
1
:
...
...
theano/gof/utils.py
浏览文件 @
a6fead02
差异被折叠。
点击展开。
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
a6fead02
...
...
@@ -9,7 +9,6 @@ import warnings
import
numpy
import
theano
from
theano.gof
import
local_bitwidth
from
theano.gof.cc
import
hash_from_file
from
theano.gof.cmodule
import
(
std_libs
,
std_lib_dirs
,
...
...
@@ -246,8 +245,6 @@ class NVCC_compiler(object):
cppfile
=
file
(
cppfilename
,
'w'
)
_logger
.
debug
(
'Writing module C++ code to
%
s'
,
cppfilename
)
ofiles
=
[]
rval
=
None
cppfile
.
write
(
src_code
)
cppfile
.
close
()
...
...
theano/tensor/extra_ops.py
浏览文件 @
a6fead02
...
...
@@ -259,7 +259,7 @@ class RepeatOp(theano.Op):
%
numpy_unsupported_dtypes
),
repeats
.
dtype
)
if
self
.
axis
is
None
:
broadcastable
=
[
False
]
broadcastable
=
[
False
]
else
:
try
:
const_reps
=
basic
.
get_scalar_constant_value
(
repeats
)
...
...
theano/tensor/tests/test_extra_ops.py
浏览文件 @
a6fead02
...
...
@@ -13,6 +13,7 @@ from theano import config, tensor, function
numpy_ver
=
[
int
(
n
)
for
n
in
numpy
.
__version__
.
split
(
'.'
)[:
2
]]
numpy_16
=
bool
(
numpy_ver
>=
[
1
,
6
])
class
TestBinCountOp
(
utt
.
InferShapeTester
):
def
setUp
(
self
):
super
(
TestBinCountOp
,
self
)
.
setUp
()
...
...
@@ -188,7 +189,6 @@ class SqueezeTester(utt.InferShapeTester):
def
test_grad
(
self
):
for
shape
,
broadcast
in
zip
(
self
.
shape_list
,
self
.
broadcast_list
):
data
=
numpy
.
random
.
random
(
size
=
shape
)
.
astype
(
theano
.
config
.
floatX
)
variable
=
tensor
.
TensorType
(
theano
.
config
.
floatX
,
broadcast
)()
utt
.
verify_grad
(
self
.
op
,
[
data
])
...
...
@@ -287,11 +287,12 @@ class TestRepeatOp(utt.InferShapeTester):
x
=
T
.
TensorType
(
config
.
floatX
,
[
False
,
True
,
False
])()
r
=
RepeatOp
(
axis
=
1
)(
x
,
2
)
self
.
assertEqual
(
r
.
broadcastable
,
(
False
,
False
,
False
))
r
=
RepeatOp
(
axis
=
1
)(
x
,
1
)
r
=
RepeatOp
(
axis
=
1
)(
x
,
1
)
self
.
assertEqual
(
r
.
broadcastable
,
(
False
,
True
,
False
))
r
=
RepeatOp
(
axis
=
0
)(
x
,
2
)
r
=
RepeatOp
(
axis
=
0
)(
x
,
2
)
self
.
assertEqual
(
r
.
broadcastable
,
(
False
,
True
,
False
))
class
TestBartlett
(
utt
.
InferShapeTester
):
def
setUp
(
self
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论