Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0925ce7a
提交
0925ce7a
authored
7月 15, 2011
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Auto indentation.
上级
115c38aa
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
12 行增加
和
17 行删除
+12
-17
io.py
theano/compile/io.py
+2
-4
configdefaults.py
theano/configdefaults.py
+1
-1
callcache.py
theano/gof/callcache.py
+3
-4
compilelock.py
theano/gof/compilelock.py
+3
-4
__init__.py
theano/sandbox/cuda/__init__.py
+2
-2
elemwise.py
theano/sandbox/cuda/elemwise.py
+1
-2
没有找到文件。
theano/compile/io.py
浏览文件 @
0925ce7a
...
@@ -61,9 +61,9 @@ class SymbolicInput(object):
...
@@ -61,9 +61,9 @@ class SymbolicInput(object):
raise
TypeError
(
"name must be a string! (got:
%
s)"
%
self
.
name
)
raise
TypeError
(
"name must be a string! (got:
%
s)"
%
self
.
name
)
self
.
update
=
update
self
.
update
=
update
if
(
mutable
is
not
None
):
if
(
mutable
is
not
None
):
self
.
mutable
=
mutable
self
.
mutable
=
mutable
else
:
else
:
self
.
mutable
=
(
update
is
not
None
)
self
.
mutable
=
(
update
is
not
None
)
self
.
strict
=
strict
self
.
strict
=
strict
self
.
allow_downcast
=
allow_downcast
self
.
allow_downcast
=
allow_downcast
...
@@ -255,5 +255,3 @@ class SymbolicOutput(object):
...
@@ -255,5 +255,3 @@ class SymbolicOutput(object):
return
"Out(
%
s,
%
s)"
%
(
self
.
variable
,
self
.
borrow
)
return
"Out(
%
s,
%
s)"
%
(
self
.
variable
,
self
.
borrow
)
Out
=
SymbolicOutput
Out
=
SymbolicOutput
theano/configdefaults.py
浏览文件 @
0925ce7a
...
@@ -113,7 +113,7 @@ def get_home_dir():
...
@@ -113,7 +113,7 @@ def get_home_dir():
home
=
os
.
getenv
(
'USERPROFILE'
)
home
=
os
.
getenv
(
'USERPROFILE'
)
assert
home
is
not
None
assert
home
is
not
None
return
home
return
home
AddConfigVar
(
'home'
,
AddConfigVar
(
'home'
,
"User home directory"
,
"User home directory"
,
StrParam
(
get_home_dir
()),
StrParam
(
get_home_dir
()),
...
...
theano/gof/callcache.py
浏览文件 @
0925ce7a
...
@@ -7,7 +7,7 @@ class CallCache(object):
...
@@ -7,7 +7,7 @@ class CallCache(object):
self
.
filename
=
filename
self
.
filename
=
filename
try
:
try
:
if
filename
is
None
:
if
filename
is
None
:
raise
IOError
(
'bad filename'
)
#just goes to except
raise
IOError
(
'bad filename'
)
#just goes to except
f
=
file
(
filename
,
'r'
)
f
=
file
(
filename
,
'r'
)
self
.
cache
=
cPickle
.
load
(
f
)
self
.
cache
=
cPickle
.
load
(
f
)
f
.
close
()
f
.
close
()
...
@@ -16,7 +16,7 @@ class CallCache(object):
...
@@ -16,7 +16,7 @@ class CallCache(object):
def
persist
(
self
,
filename
=
None
):
def
persist
(
self
,
filename
=
None
):
if
filename
is
None
:
if
filename
is
None
:
filename
=
self
.
filename
filename
=
self
.
filename
#backport
#backport
#filename = self.filename if filename is None else filename
#filename = self.filename if filename is None else filename
...
@@ -26,7 +26,7 @@ class CallCache(object):
...
@@ -26,7 +26,7 @@ class CallCache(object):
def
call
(
self
,
fn
,
args
=
(),
key
=
None
):
def
call
(
self
,
fn
,
args
=
(),
key
=
None
):
if
key
is
None
:
if
key
is
None
:
key
=
(
fn
,
tuple
(
args
))
key
=
(
fn
,
tuple
(
args
))
#backport
#backport
#key = (fn, tuple(args)) if key is None else key
#key = (fn, tuple(args)) if key is None else key
...
@@ -43,4 +43,3 @@ class CallCache(object):
...
@@ -43,4 +43,3 @@ class CallCache(object):
self
.
persist
()
self
.
persist
()
except
Exception
,
e
:
except
Exception
,
e
:
_logger
.
error
(
'persist failed
%
s
%
s'
,
self
.
filename
,
e
)
_logger
.
error
(
'persist failed
%
s
%
s'
,
self
.
filename
,
e
)
theano/gof/compilelock.py
浏览文件 @
0925ce7a
...
@@ -196,7 +196,7 @@ def lock(tmp_dir, timeout=120, min_wait=5, max_wait=10, verbosity=1):
...
@@ -196,7 +196,7 @@ def lock(tmp_dir, timeout=120, min_wait=5, max_wait=10, verbosity=1):
if
verbosity
<=
1
:
if
verbosity
<=
1
:
no_display
=
True
no_display
=
True
time
.
sleep
(
random
.
uniform
(
min_wait
,
max_wait
))
time
.
sleep
(
random
.
uniform
(
min_wait
,
max_wait
))
try
:
try
:
os
.
mkdir
(
tmp_dir
)
os
.
mkdir
(
tmp_dir
)
except
OSError
:
except
OSError
:
...
@@ -205,10 +205,10 @@ def lock(tmp_dir, timeout=120, min_wait=5, max_wait=10, verbosity=1):
...
@@ -205,10 +205,10 @@ def lock(tmp_dir, timeout=120, min_wait=5, max_wait=10, verbosity=1):
continue
continue
# Safety check: the directory should be here.
# Safety check: the directory should be here.
assert
os
.
path
.
isdir
(
tmp_dir
)
assert
os
.
path
.
isdir
(
tmp_dir
)
# Write own id into lock file.
# Write own id into lock file.
unique_id
=
refresh_lock
(
lock_file
)
unique_id
=
refresh_lock
(
lock_file
)
# Verify we are really the lock owner (this should not be needed,
# Verify we are really the lock owner (this should not be needed,
# but better be safe than sorry).
# but better be safe than sorry).
owner
=
open
(
lock_file
)
.
readlines
()[
0
]
.
strip
()
owner
=
open
(
lock_file
)
.
readlines
()[
0
]
.
strip
()
...
@@ -276,4 +276,3 @@ class Unlocker(object):
...
@@ -276,4 +276,3 @@ class Unlocker(object):
self
.
os
.
rmdir
(
self
.
tmp_dir
)
self
.
os
.
rmdir
(
self
.
tmp_dir
)
except
:
except
:
pass
pass
theano/sandbox/cuda/__init__.py
浏览文件 @
0925ce7a
...
@@ -114,7 +114,7 @@ except Exception, e:
...
@@ -114,7 +114,7 @@ except Exception, e:
set_cuda_disabled
()
set_cuda_disabled
()
if
cuda_available
:
if
cuda_available
:
# If necessary,
# If necessary,
# create a symlink called libcuda_ndarray.so
# create a symlink called libcuda_ndarray.so
# which nvcc_module_compile_str uses when linking
# which nvcc_module_compile_str uses when linking
# any module except "cuda_ndarray" itself.
# any module except "cuda_ndarray" itself.
...
@@ -186,7 +186,7 @@ def use(device,
...
@@ -186,7 +186,7 @@ def use(device,
"nvcc was not found. Set it in your PATH "
"nvcc was not found. Set it in your PATH "
"environment variable or set the Theano "
"environment variable or set the Theano "
"flags 'cuda.root' to its directory"
%
device
)
"flags 'cuda.root' to its directory"
%
device
)
else
:
else
:
raise
EnvironmentError
(
"You forced the use of gpu device
%
s, "
raise
EnvironmentError
(
"You forced the use of gpu device
%
s, "
"but CUDA initialization failed "
"but CUDA initialization failed "
"with error:
\n
%
s"
%
(
"with error:
\n
%
s"
%
(
...
...
theano/sandbox/cuda/elemwise.py
浏览文件 @
0925ce7a
...
@@ -667,7 +667,7 @@ nd_collapse_[i]=0;
...
@@ -667,7 +667,7 @@ nd_collapse_[i]=0;
l
=
[
"local_str[
%(ipos)
s][nd_collapse-1]==1 "
%
locals
()
for
ipos
in
range
(
len
(
node
.
inputs
))
if
not
_logical_scalar
(
node
.
inputs
[
ipos
])]
l
=
[
"local_str[
%(ipos)
s][nd_collapse-1]==1 "
%
locals
()
for
ipos
in
range
(
len
(
node
.
inputs
))
if
not
_logical_scalar
(
node
.
inputs
[
ipos
])]
l
+=
[
"local_ostr[
%(ipos)
s][nd_collapse-1]==1 "
%
locals
()
for
ipos
in
range
(
len
(
node
.
outputs
))
if
not
_logical_scalar
(
node
.
outputs
[
ipos
])]
l
+=
[
"local_ostr[
%(ipos)
s][nd_collapse-1]==1 "
%
locals
()
for
ipos
in
range
(
len
(
node
.
outputs
))
if
not
_logical_scalar
(
node
.
outputs
[
ipos
])]
if
len
(
l
)
>
0
:
if
len
(
l
)
>
0
:
print
>>
sio
,
" && "
,
" && "
.
join
(
l
)
print
>>
sio
,
" && "
,
" && "
.
join
(
l
)
print
>>
sio
,
"""){nd_collapse=0;} """
print
>>
sio
,
"""){nd_collapse=0;} """
if
self
.
verbose
:
if
self
.
verbose
:
...
@@ -956,4 +956,3 @@ nd_collapse_[i]=0;
...
@@ -956,4 +956,3 @@ nd_collapse_[i]=0;
#define INTDIV_POW2(a, b) (a >> b)
#define INTDIV_POW2(a, b) (a >> b)
#define INTMOD_POW2(a, b) (a & ((1<<b)-1))
#define INTMOD_POW2(a, b) (a & ((1<<b)-1))
"""
"""
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论