Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ba4178f7
提交
ba4178f7
authored
11月 30, 2009
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
backported import and any to python 2.4
上级
28dfa5e3
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
17 行增加
和
16 行删除
+17
-16
__init__.py
theano/sandbox/cuda/__init__.py
+2
-2
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+3
-3
blas.py
theano/sandbox/cuda/blas.py
+1
-1
nnet.py
theano/sandbox/cuda/nnet.py
+2
-2
opt.py
theano/sandbox/cuda/opt.py
+4
-3
type.py
theano/sandbox/cuda/type.py
+2
-2
var.py
theano/sandbox/cuda/var.py
+3
-3
没有找到文件。
theano/sandbox/cuda/__init__.py
浏览文件 @
ba4178f7
from
.type
import
CudaNdarrayType
from
theano.sandbox.cuda
.type
import
CudaNdarrayType
from
.var
import
(
CudaNdarrayVariable
,
from
theano.sandbox.cuda
.var
import
(
CudaNdarrayVariable
,
CudaNdarrayConstant
,
CudaNdarrayConstant
,
CudaNdarraySharedVariable
,
CudaNdarraySharedVariable
,
shared_constructor
)
shared_constructor
)
...
...
theano/sandbox/cuda/basic_ops.py
浏览文件 @
ba4178f7
...
@@ -4,10 +4,10 @@ import numpy
...
@@ -4,10 +4,10 @@ import numpy
from
theano
import
Op
,
Type
,
Apply
,
Variable
,
Constant
from
theano
import
Op
,
Type
,
Apply
,
Variable
,
Constant
from
theano
import
tensor
,
scalar
from
theano
import
tensor
,
scalar
from
.type
import
CudaNdarrayType
from
theano.sandbox.cuda
.type
import
CudaNdarrayType
from
.type_support
import
filter
as
type_support_filter
from
theano.sandbox.cuda
.type_support
import
filter
as
type_support_filter
from
.elemwise
import
NaiveAlgo
from
theano.sandbox.cuda
.elemwise
import
NaiveAlgo
import
logging
,
copy
import
logging
,
copy
_logger_name
=
'theano_cuda_ndarray.basic_ops'
_logger_name
=
'theano_cuda_ndarray.basic_ops'
...
...
theano/sandbox/cuda/blas.py
浏览文件 @
ba4178f7
...
@@ -3,7 +3,7 @@ from theano import tensor, scalar
...
@@ -3,7 +3,7 @@ from theano import tensor, scalar
import
StringIO
import
StringIO
import
cuda_ndarray
import
cuda_ndarray
from
.type
import
CudaNdarrayType
from
theano.sandbox.cuda
.type
import
CudaNdarrayType
class
GpuDot22
(
Op
):
class
GpuDot22
(
Op
):
def
__str__
(
self
):
def
__str__
(
self
):
...
...
theano/sandbox/cuda/nnet.py
浏览文件 @
ba4178f7
...
@@ -3,9 +3,9 @@ from theano import tensor, scalar
...
@@ -3,9 +3,9 @@ from theano import tensor, scalar
import
StringIO
import
StringIO
import
cuda_ndarray
import
cuda_ndarray
from
.type
import
CudaNdarrayType
from
theano.sandbox.cuda
.type
import
CudaNdarrayType
from
.kernel_codegen
import
nvcc_kernel
,
inline_reduce_max
,
inline_reduce_sum
,
inline_softmax
from
theano.sandbox.cuda
.kernel_codegen
import
nvcc_kernel
,
inline_reduce_max
,
inline_reduce_sum
,
inline_softmax
class
GpuCrossentropySoftmaxArgmax1HotWithBias
(
Op
):
class
GpuCrossentropySoftmaxArgmax1HotWithBias
(
Op
):
nin
=
3
nin
=
3
...
...
theano/sandbox/cuda/opt.py
浏览文件 @
ba4178f7
import
sys
import
sys
import
theano
import
theano
import
numpy
from
theano
import
tensor
,
scalar
,
compile
from
theano
import
tensor
,
scalar
,
compile
from
theano.gof
import
local_optimizer
,
EquilibriumDB
,
SequenceDB
from
theano.gof
import
local_optimizer
,
EquilibriumDB
,
SequenceDB
...
@@ -47,8 +48,8 @@ gpu_cut_copies.register('cut_gpu_constant_transfers', tensor.opt.constant_foldin
...
@@ -47,8 +48,8 @@ gpu_cut_copies.register('cut_gpu_constant_transfers', tensor.opt.constant_foldin
@local_optimizer
([])
@local_optimizer
([])
def
local_gpu_elemwise_0
(
node
):
def
local_gpu_elemwise_0
(
node
):
if
isinstance
(
node
.
op
,
tensor
.
Elemwise
):
if
isinstance
(
node
.
op
,
tensor
.
Elemwise
):
if
any
(
hasattr
(
i
.
owner
,
'op'
)
and
isinstance
(
i
.
owner
.
op
,
HostFromGpu
)
for
i
in
node
.
inputs
):
if
numpy
.
any
(
hasattr
(
i
.
owner
,
'op'
)
and
isinstance
(
i
.
owner
.
op
,
HostFromGpu
)
for
i
in
node
.
inputs
):
if
any
(
o
.
type
.
dtype
==
'float64'
for
o
in
node
.
outputs
):
if
numpy
.
any
(
o
.
type
.
dtype
==
'float64'
for
o
in
node
.
outputs
):
print
'WARNING: THERE ARE STILL float64s in your graph local_gpu_elemwise_0'
,
node
print
'WARNING: THERE ARE STILL float64s in your graph local_gpu_elemwise_0'
,
node
else
:
else
:
# move the add to a GpuAdd
# move the add to a GpuAdd
...
@@ -110,7 +111,7 @@ def local_gpu_dot(node):
...
@@ -110,7 +111,7 @@ def local_gpu_dot(node):
x
,
y
=
host_input
.
owner
.
inputs
x
,
y
=
host_input
.
owner
.
inputs
return
[
gpu_dot22
(
gpu_from_host
(
x
),
gpu_from_host
(
y
))]
return
[
gpu_dot22
(
gpu_from_host
(
x
),
gpu_from_host
(
y
))]
if
node
.
op
==
tensor
.
blas
.
_dot22
:
if
node
.
op
==
tensor
.
blas
.
_dot22
:
if
any
((
i
.
owner
and
i
.
owner
.
op
==
host_from_gpu
)
for
i
in
node
.
inputs
):
if
numpy
.
any
((
i
.
owner
and
i
.
owner
.
op
==
host_from_gpu
)
for
i
in
node
.
inputs
):
x
,
y
=
node
.
inputs
x
,
y
=
node
.
inputs
return
[
host_from_gpu
(
gpu_dot22
(
gpu_from_host
(
x
),
gpu_from_host
(
y
)))]
return
[
host_from_gpu
(
gpu_dot22
(
gpu_from_host
(
x
),
gpu_from_host
(
y
)))]
return
False
return
False
...
...
theano/sandbox/cuda/type.py
浏览文件 @
ba4178f7
...
@@ -9,9 +9,9 @@ import theano.config as config
...
@@ -9,9 +9,9 @@ import theano.config as config
import
cuda_ndarray
import
cuda_ndarray
from
.type_support
import
filter
as
type_support_filter
from
theano.sandbox.cuda
.type_support
import
filter
as
type_support_filter
from
.nvcc_compiler
import
nvcc_module_compile_str
from
theano.sandbox.cuda
.nvcc_compiler
import
nvcc_module_compile_str
class
CudaNdarrayType
(
Type
):
class
CudaNdarrayType
(
Type
):
...
...
theano/sandbox/cuda/var.py
浏览文件 @
ba4178f7
...
@@ -4,10 +4,10 @@ from theano import Op, Type, Apply, Variable, Constant
...
@@ -4,10 +4,10 @@ from theano import Op, Type, Apply, Variable, Constant
from
theano
import
tensor
from
theano
import
tensor
from
theano.compile.sandbox.sharedvalue
import
shared
,
SharedVariable
,
shared_constructor
from
theano.compile.sandbox.sharedvalue
import
shared
,
SharedVariable
,
shared_constructor
from
.type
import
CudaNdarrayType
from
theano.sandbox.cuda
.type
import
CudaNdarrayType
from
.type_support
import
filter
as
type_support_filter
from
theano.sandbox.cuda
.type_support
import
filter
as
type_support_filter
from
.basic_ops
import
HostFromGpu
,
GpuFromHost
from
theano.sandbox.cuda
.basic_ops
import
HostFromGpu
,
GpuFromHost
class
_operators
(
tensor
.
basic
.
_tensor_py_operators
):
class
_operators
(
tensor
.
basic
.
_tensor_py_operators
):
"""Define a few properties and conversion methods for CudaNdarray Variables.
"""Define a few properties and conversion methods for CudaNdarray Variables.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论