Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
763d3aa5
提交
763d3aa5
authored
12月 12, 2011
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Typo fixes
上级
a4d57432
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
13 行删除
+13
-13
ctype.txt
doc/extending/ctype.txt
+7
-7
function_module.py
theano/compile/function_module.py
+6
-6
没有找到文件。
doc/extending/ctype.txt
浏览文件 @
763d3aa5
...
@@ -507,9 +507,9 @@ DeepCopyOp
...
@@ -507,9 +507,9 @@ DeepCopyOp
We have an internal Op called DeepCopyOp. It is used to make sure we
We have an internal Op called DeepCopyOp. It is used to make sure we
respect the user vs Theano memory region as described in the :ref:`tutorial
respect the user vs Theano memory region as described in the :ref:`tutorial
<aliasing>`. Theano ha
ve a python implementation that call the object
<aliasing>`. Theano ha
s a Python implementation that calls the object's
``copy()`` or
``deepcopy()`` method for Theano Type that it don't know
``copy()`` or
``deepcopy()`` method for Theano types for which it does not
how to generate c
code.
know how to generate C
code.
You can implement c_code for this op. You register it like this:
You can implement c_code for this op. You register it like this:
...
@@ -517,10 +517,10 @@ You can implement c_code for this op. You register it like this:
...
@@ -517,10 +517,10 @@ You can implement c_code for this op. You register it like this:
theano.compile.function_module.register_DeepCopyOp_c_code(YOUR_TYPE_CLASS, THE_C_CODE)
theano.compile.function_module.register_DeepCopyOp_c_code(YOUR_TYPE_CLASS, THE_C_CODE)
In your
c
code, you should use %(iname)s and %(oname)s to represent
In your
C
code, you should use %(iname)s and %(oname)s to represent
the
c variable name
of the DeepCopyOp input and output
the
C variable names
of the DeepCopyOp input and output
respectively. See an example for the
gpu object in the file
respectively. See an example for the
type ``CudaNdarrayType`` (GPU array)
`theano/sandbox/cuda/type.py`.
in the file
`theano/sandbox/cuda/type.py`.
Output Guard
Output Guard
============
============
...
...
theano/compile/function_module.py
浏览文件 @
763d3aa5
...
@@ -130,13 +130,13 @@ class AliasedMemoryError(Exception):
...
@@ -130,13 +130,13 @@ class AliasedMemoryError(Exception):
###
###
def
register_DeepCopyOp_c_code
(
typ
,
code
):
def
register_DeepCopyOp_c_code
(
typ
,
code
):
""" Tell DeepCopyOp how to generate
c
code for a Theano Type
""" Tell DeepCopyOp how to generate
C
code for a Theano Type
:param typ: A Theano type. It must be theano class itself and not an
:param typ: A Theano type. It must be the
The
ano class itself and not an
object
of the class.
instance
of the class.
:param code: C code that deep cop
y
the Theano type 'typ'.
:param code: C code that deep cop
ies
the Theano type 'typ'.
use
%(iname)
s and
%(oname)
s for the input and output c
Use
%(iname)
s and
%(oname)
s for the input and output C
variable name respectively.
variable name
s
respectively.
"""
"""
DeepCopyOp
.
c_codes
[
typ
]
=
code
DeepCopyOp
.
c_codes
[
typ
]
=
code
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论