Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f5dcfd94
提交
f5dcfd94
authored
12月 22, 2010
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
white space fix.
上级
594d8d2f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
5 行增加
和
5 行删除
+5
-5
var.py
theano/sandbox/cuda/var.py
+5
-5
没有找到文件。
theano/sandbox/cuda/var.py
浏览文件 @
f5dcfd94
...
@@ -19,7 +19,7 @@ class _operators(tensor.basic._tensor_py_operators):
...
@@ -19,7 +19,7 @@ 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.
The default implementation of arithemetic operators is to build graphs of TensorType
The default implementation of arithemetic operators is to build graphs of TensorType
variables.
variables.
The optimization pass (specialization) will insert pure GPU implementations.
The optimization pass (specialization) will insert pure GPU implementations.
This approach relieves the Cuda-Ops of having to deal with input argument checking and
This approach relieves the Cuda-Ops of having to deal with input argument checking and
...
@@ -60,7 +60,7 @@ class CudaNdarraySharedVariable(SharedVariable, _operators):
...
@@ -60,7 +60,7 @@ class CudaNdarraySharedVariable(SharedVariable, _operators):
"""
"""
Return the value of this SharedVariable's internal array.
Return the value of this SharedVariable's internal array.
:param borrow:
:param borrow:
permit the return of internal storage, when used in conjunction with
permit the return of internal storage, when used in conjunction with
``return_internal_type=True``
``return_internal_type=True``
:param return_internal_type:
:param return_internal_type:
...
@@ -110,7 +110,7 @@ class CudaNdarraySharedVariable(SharedVariable, _operators):
...
@@ -110,7 +110,7 @@ class CudaNdarraySharedVariable(SharedVariable, _operators):
* You change the value of the shared variable via set_value, not via the .value
* You change the value of the shared variable via set_value, not via the .value
accessors. You should not use the .value accessors anyway, since they will soon be
accessors. You should not use the .value accessors anyway, since they will soon be
deprecated and removed.
deprecated and removed.
It is also worth mentioning that, for efficient transfer to the GPU, Theano will make the new data
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.
``c_contiguous``. This can require an extra copy of the data on the host.
"""
"""
...
@@ -142,7 +142,7 @@ def cuda_shared_constructor(value, name=None, strict=False,
...
@@ -142,7 +142,7 @@ def cuda_shared_constructor(value, name=None, strict=False,
# THIS CONSTRUCTOR TRIES TO CAST VALUE TO A FLOAT32, WHICH THEN GOES ONTO THE CARD
# THIS CONSTRUCTOR TRIES TO CAST VALUE TO A FLOAT32, WHICH THEN GOES ONTO THE CARD
# SO INT shared vars, float64 shared vars, etc. all end up on the card.
# SO INT shared vars, float64 shared vars, etc. all end up on the card.
# THIS IS NOT THE DEFAULT BEHAVIOUR THAT WE WANT.
# THIS IS NOT THE DEFAULT BEHAVIOUR THAT WE WANT.
# SEE float32_shared_constructor
# SEE float32_shared_constructor
#TODO: what should strict mean in this context, since we always have to make a copy?
#TODO: what should strict mean in this context, since we always have to make a copy?
...
@@ -172,7 +172,7 @@ def float32_shared_constructor(value, name=None, strict=False,
...
@@ -172,7 +172,7 @@ def float32_shared_constructor(value, name=None, strict=False,
"""SharedVariable Constructor for CudaNdarrayType from numpy.ndarray or CudaNdarray"""
"""SharedVariable Constructor for CudaNdarrayType from numpy.ndarray or CudaNdarray"""
# if value isn't a float32 ndarray, or a CudaNdarray then raise
# if value isn't a float32 ndarray, or a CudaNdarray then raise
if
not
isinstance
(
value
,
(
numpy
.
ndarray
,
theano
.
sandbox
.
cuda
.
CudaNdarray
)):
if
not
isinstance
(
value
,
(
numpy
.
ndarray
,
theano
.
sandbox
.
cuda
.
CudaNdarray
)):
raise
TypeError
(
'ndarray or CudaNdarray required'
)
raise
TypeError
(
'ndarray or CudaNdarray required'
)
if
isinstance
(
value
,
numpy
.
ndarray
)
and
value
.
dtype
.
num
!=
CudaNdarrayType
.
typenum
:
if
isinstance
(
value
,
numpy
.
ndarray
)
and
value
.
dtype
.
num
!=
CudaNdarrayType
.
typenum
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论