Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
88d73dd6
提交
88d73dd6
authored
7月 23, 2015
作者:
Iban Harlouchet
提交者:
Arnaud Bergeron
9月 08, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
testcode for doc/tutorial/extending_theano_c.txt
上级
6dedf856
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
extending_theano_c.txt
doc/tutorial/extending_theano_c.txt
+8
-8
没有找到文件。
doc/tutorial/extending_theano_c.txt
浏览文件 @
88d73dd6
...
@@ -129,7 +129,7 @@ that the data is not only contiguous in memory but also that it is organized
...
@@ -129,7 +129,7 @@ that the data is not only contiguous in memory but also that it is organized
such that the index of the latest dimension changes the fastest. If the
such that the index of the latest dimension changes the fastest. If the
following array
following array
..
code-block:: python
..
testcode::
x = [[1, 2, 3],
x = [[1, 2, 3],
[4, 5, 6]]
[4, 5, 6]]
...
@@ -337,7 +337,7 @@ commonly used.
...
@@ -337,7 +337,7 @@ commonly used.
of C code that you should include in your C code (after ensuring that a
of C code that you should include in your C code (after ensuring that a
Python exception is set) if it needs to raise an exception. Ex:
Python exception is set) if it needs to raise an exception. Ex:
.. code-block::
python
.. code-block::
c
c_code = """
c_code = """
PyErr_Format(PyExc_ValueError, "X does not have the right value");
PyErr_Format(PyExc_ValueError, "X does not have the right value");
...
@@ -354,7 +354,7 @@ commonly used.
...
@@ -354,7 +354,7 @@ commonly used.
``%`` characters in the format characters need to be escaped since the C
``%`` characters in the format characters need to be escaped since the C
code itself is defined in a string which undergoes string formatting.
code itself is defined in a string which undergoes string formatting.
.. code-block::
python
.. code-block::
c
c_code = """
c_code = """
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
...
@@ -440,7 +440,7 @@ need to validate that the output storage has been allocated and has the same
...
@@ -440,7 +440,7 @@ need to validate that the output storage has been allocated and has the same
shape as our vector input. If it is not the case, we allocate a new output
shape as our vector input. If it is not the case, we allocate a new output
storage with the right shape and number of dimensions.
storage with the right shape and number of dimensions.
..
code-block:: python
..
testcode:: examples
import numpy
import numpy
import theano
import theano
...
@@ -565,7 +565,7 @@ the inputs (because of the upcast in the method ``make_node()``), the typenum
...
@@ -565,7 +565,7 @@ the inputs (because of the upcast in the method ``make_node()``), the typenum
of the output has to be obtained in the Python code and then included in the
of the output has to be obtained in the Python code and then included in the
C code.
C code.
..
code-block:: python
..
testcode:: examples
class VectorTimesVector(gof.Op):
class VectorTimesVector(gof.Op):
__props__ = ()
__props__ = ()
...
@@ -705,7 +705,7 @@ implemented using the ``COp`` class.
...
@@ -705,7 +705,7 @@ implemented using the ``COp`` class.
The new op is defined inside a Python file with the following code :
The new op is defined inside a Python file with the following code :
..
code-block:: python
..
testcode::
import theano
import theano
from theano import gof
from theano import gof
...
@@ -895,7 +895,7 @@ defined to False. In these descrptions 'i' refers to the position
...
@@ -895,7 +895,7 @@ defined to False. In these descrptions 'i' refers to the position
corresponds to ``npy_float32`` and can directly be used to declare a
corresponds to ``npy_float32`` and can directly be used to declare a
new variable of the same dtype as the data in the array :
new variable of the same dtype as the data in the array :
..
code-block:: c
..
testcode::
DTYPE_INPUT_0 myVar = someValue;
DTYPE_INPUT_0 myVar = someValue;
...
@@ -914,7 +914,7 @@ In addition to these macros, the ``init_code_struct``, ``code``, and
...
@@ -914,7 +914,7 @@ In addition to these macros, the ``init_code_struct``, ``code``, and
* ``FAIL`` : Code to insert at error points. A python exception
* ``FAIL`` : Code to insert at error points. A python exception
should be set prior to this code. An invocation look like this:
should be set prior to this code. An invocation look like this:
..
code-block:: c
..
testcode::
if (error) {
if (error) {
// Set python exception
// Set python exception
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论