Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2d2e548c
提交
2d2e548c
authored
1月 21, 2011
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
差异文件
Merged
上级
e9585f45
7ed0e56d
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
19 行增加
和
12 行删除
+19
-12
cc.py
theano/gof/cc.py
+12
-5
type.py
theano/gof/type.py
+3
-3
opt.py
theano/sandbox/cuda/opt.py
+2
-2
var.py
theano/sandbox/cuda/var.py
+1
-1
Conv3D.py
theano/tensor/nnet/Conv3D.py
+1
-1
没有找到文件。
theano/gof/cc.py
浏览文件 @
2d2e548c
...
...
@@ -511,16 +511,24 @@ class CLinker(link.Linker):
op
=
node
.
op
# type-specific support code
try
:
c_support_code_apply
.
append
(
op
.
c_support_code_apply
(
node
,
name
))
except
utils
.
MethodNotDefined
:
pass
try
:
c_support_code_apply
.
append
(
op
.
c_support_code_apply
(
node
,
name
))
except
utils
.
MethodNotDefined
:
pass
else
:
# The following will be executed if the "try" block succeeds
assert
isinstance
(
c_support_code_apply
[
-
1
],
str
),
(
str
(
node
.
op
)
+
" didn't returned a string for c_support_code_apply"
)
# emit c_code
try
:
behavior
=
op
.
c_code
(
node
,
name
,
isyms
,
osyms
,
sub
)
try
:
behavior
=
op
.
c_code
(
node
,
name
,
isyms
,
osyms
,
sub
)
except
utils
.
MethodNotDefined
:
raise
NotImplementedError
(
"
%
s cannot produce C code"
%
op
)
assert
isinstance
(
behavior
,
str
),
str
(
node
.
op
)
+
" didn't returned a string for c_code"
try
:
cleanup
=
op
.
c_code_cleanup
(
node
,
name
,
isyms
,
osyms
,
sub
)
try
:
cleanup
=
op
.
c_code_cleanup
(
node
,
name
,
isyms
,
osyms
,
sub
)
except
utils
.
MethodNotDefined
:
cleanup
=
""
...
...
@@ -1305,4 +1313,3 @@ class DualLinker(link.Linker):
link
.
raise_with_op
(
node1
)
return
f
,
i1
,
o1
theano/gof/type.py
浏览文件 @
2d2e548c
...
...
@@ -214,8 +214,9 @@ class PureType(object):
data passed as an argument. If it is False, and allow_downcast
is True, filter may cast it to an appropriate type. If
allow_downcast is False, filter may only upcast it, not lose
precision. If allow_downcast is None, only Python float can be
downcasted, and only to a floatX scalar.
precision. If allow_downcast is None, the behaviour can be
Type-dependant, but for now only Python float can be downcasted,
and only to a floatX scalar.
:Exceptions:
- `MethodNotDefined`: subclass doesn't implement this function.
...
...
@@ -390,4 +391,3 @@ class Generic(SingletonType):
"""
%
locals
()
generic
=
Generic
()
theano/sandbox/cuda/opt.py
浏览文件 @
2d2e548c
...
...
@@ -189,7 +189,7 @@ def local_gpu_dot_to_dot22(node):
# case two: matrix X vector
elif
_is_real_matrix
(
x
)
and
_is_real_vector
(
y
):
new_op
=
GpuDimShuffle
((
False
,),
[
0
,
'x'
])
shape_out
=
x
.
shape
[
1
]
.
dimshuffle
([
'x'
])
shape_out
=
x
.
shape
[
0
]
.
dimshuffle
([
'x'
])
gpu_x
=
gpu_from_host
(
x
)
gpu_y
=
new_op
(
gpu_from_host
(
y
))
else
:
...
...
@@ -207,7 +207,7 @@ def local_gpu_dot_to_dot22(node):
elif
_is_real_matrix
(
x
)
and
_is_real_vector
(
y
):
new_op
=
GpuDimShuffle
((
False
,),
[
0
,
'x'
])
shape_out
=
x
.
shape
[
1
]
.
dimshuffle
([
'x'
])
shape_out
=
x
.
shape
[
0
]
.
dimshuffle
([
'x'
])
gpu_x
=
gpu_from_host
(
x
)
gpu_y
=
new_op
(
gpu_from_host
(
y
))
else
:
...
...
theano/sandbox/cuda/var.py
浏览文件 @
2d2e548c
...
...
@@ -118,7 +118,7 @@ class CudaNdarraySharedVariable(SharedVariable, _operators):
It is also worth mentioning that, for efficient transfer to the GPU, Theano will make the new data
``c_contiguous``. This can require an extra copy of the data on the host.
Th
is work what when borrow=True and when borrow=False
Th
e inplace on gpu memory work when borrow is either True or False.
"""
if
not
borrow
:
#TODO: check for cuda_ndarray type
...
...
theano/tensor/nnet/Conv3D.py
浏览文件 @
2d2e548c
...
...
@@ -340,7 +340,7 @@ class Conv3D(theano.Op):
codeSource
+=
"""
if (inputChannels > 20 && outputChannels > 20 && ws4 == sizeof(ELEM_AT(
%(W)
s,0)))
{
std::cout << "lots of channels special case code" << std::endl;
//
std::cout << "lots of channels special case code" << std::endl;
#define blas_type dtype_ ##
%(V)
s
const blas_type constant_one = 1.0;
char N = 'T';
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论