Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
840176c8
提交
840176c8
authored
11月 14, 2011
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'nouiz-doc_str'
上级
4bb2f3f6
bf7320ea
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
44 行增加
和
7 行删除
+44
-7
cop.txt
doc/extending/cop.txt
+18
-1
ctype.txt
doc/extending/ctype.txt
+26
-6
没有找到文件。
doc/extending/cop.txt
浏览文件 @
840176c8
...
@@ -54,7 +54,16 @@ There are less methods to define for an Op than for a Type:
...
@@ -54,7 +54,16 @@ There are less methods to define for an Op than for a Type:
.. method:: c_support_code()
.. method:: c_support_code()
Allows you to specify helper functions/structs that the type needs. See :ref:`op`.
Allows you to specify helper functions/structs that the
:ref:`op` needs. That code will be reused for each apply of
this op. It will be inserted at global scope.
.. method:: c_support_code_apply(node, name)
Allows you to specify helper functions/structs specialized for a
particular apply of an :ref:`op`. Use `c_support_code` if the
code is the same for each apply of an op.
It will be inserted at global scope.
.. method:: infer_shape(node, (i0_shapes,i1_shapes,...))
.. method:: infer_shape(node, (i0_shapes,i1_shapes,...))
...
@@ -66,6 +75,14 @@ There are less methods to define for an Op than for a Type:
...
@@ -66,6 +75,14 @@ There are less methods to define for an Op than for a Type:
(node, ((x0,x1), (y0,y1))) and should return [(x0, y1)]. Both the
(node, ((x0,x1), (y0,y1))) and should return [(x0, y1)]. Both the
inputs and the return value may be theano variables.
inputs and the return value may be theano variables.
.. method:: c_code_cache_version()
Should return a tuple of hashable objects like integers. This
specifies the version of the code. It is used to cache the
compiled code. You MUST change the returned tuple for each
change in the code. If you don't want to cache the compiled code
return an empty tuple or don't implement it.
The ``name`` argument is currently given an invalid value, so steer
The ``name`` argument is currently given an invalid value, so steer
away from it. As was the case with Type, ``sub['fail']`` provides
away from it. As was the case with Type, ``sub['fail']`` provides
failure code that you *must* use if you want to raise an exception,
failure code that you *must* use if you want to raise an exception,
...
...
doc/extending/ctype.txt
浏览文件 @
840176c8
...
@@ -78,15 +78,35 @@ the most important ones:
...
@@ -78,15 +78,35 @@ the most important ones:
When we are done using the data, clean up whatever we allocated and
When we are done using the data, clean up whatever we allocated and
decrease the appropriate reference counts.
decrease the appropriate reference counts.
.. method:: c_headers()
c_libraries()
c_header_dirs()
c_lib_dirs()
Allows you to specify headers, libraries and associated directories.
.. method:: c_compile_args()
.. method:: c_compile_args()
c_no_compile_args()
c_no_compile_args()
c_headers()
c_libraries()
c_support_code()
Allows you to specify headers, libraries,
Allows to specify special compiler arguments to add/exclude.
special g++ arguments to add/exclude or
helper functions/structs that the type needs. See :ref:`type`.
.. method:: c_support_code()
Allows to add helper functions/structs that the :ref:`type` needs.
.. method:: c_compiler()
Allows to specify a special compiler. This will force this compiler
for the current compilation block (a particular op or the full graph).
This is used for the GPU code.
.. method:: c_code_cache_version()
Should return a tuple of hashable objects like integers. This
specifies the version of the code. It is used to cache the
compiled code. You MUST change the returned tuple for each
change in the code. If you don't want to cache the compiled code
return an empty tuple or don't implement it.
Each of these functions take two arguments, ``name`` and ``sub`` which
Each of these functions take two arguments, ``name`` and ``sub`` which
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论