Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
59fbcaee
提交
59fbcaee
authored
6月 19, 2014
作者:
Hengjean
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Changed the use location of the global check_input flag. Removed no more relevant lines in doc.
上级
23104525
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
9 行增加
和
9 行删除
+9
-9
fibby.txt
doc/extending/fibby.txt
+1
-2
cc.py
theano/gof/cc.py
+3
-2
type.py
theano/sandbox/cuda/type.py
+1
-1
basic.py
theano/scalar/basic.py
+1
-1
type.py
theano/tensor/type.py
+1
-1
test_tutorial.py
theano/tests/test_tutorial.py
+2
-2
没有找到文件。
doc/extending/fibby.txt
浏览文件 @
59fbcaee
...
...
@@ -141,8 +141,7 @@ The ``c_code`` method accepts variable names as arguments (``name``, ``inames``,
``onames``) and returns a C code fragment that computes the expression output.
In case of error, the ``%(fail)s`` statement cleans up and returns properly.
The variables ``%(x)s`` and ``%(y)s`` are set up by the TensorType to be ``PyArrayObject`` pointers.
TensorType also set up ``dtype_%(x)s`` to be a typdef to the C type for ``x``,
``type_num_%(x)s`` is the corresponding NumPy type number.
TensorType also set up ``dtype_%(x)s`` to be a typdef to the C type for ``x``.
In the first two lines of the C function, we make y point to a new array with
the correct size for the output. This is essentially simulating the line
...
...
theano/gof/cc.py
浏览文件 @
59fbcaee
...
...
@@ -333,7 +333,8 @@ def get_c_init(r, name, sub):
def
get_c_extract
(
r
,
name
,
sub
):
"""Wrapper around c_extract that initializes py_name from storage."""
if
any
([
getattr
(
c
.
op
,
'check_input'
,
True
)
for
(
c
,
_
)
in
r
.
clients
]):
if
any
([
getattr
(
c
.
op
,
'check_input'
,
config
.
check_input
)
for
(
c
,
_
)
in
r
.
clients
]):
c_extract
=
r
.
type
.
c_extract
(
name
,
sub
,
True
)
else
:
...
...
@@ -349,7 +350,7 @@ def get_c_extract(r, name, sub):
def
get_c_extract_out
(
r
,
name
,
sub
):
"""Wrapper around c_extract_out that initializes py_name from storage."""
c_extract
=
r
.
type
.
c_extract_out
(
name
,
sub
,
getattr
(
r
.
owner
.
op
,
'check_input'
,
True
))
getattr
(
r
.
owner
.
op
,
'check_input'
,
config
.
check_input
))
pre
=
"""
py_
%(name)
s = PyList_GET_ITEM(storage_
%(name)
s, 0);
...
...
theano/sandbox/cuda/type.py
浏览文件 @
59fbcaee
...
...
@@ -294,7 +294,7 @@ class CudaNdarrayType(Type):
%(name)
s = (CudaNdarray*)py_
%(name)
s;
//std::cerr << "c_extract " <<
%(name)
s << '
\\
n';
"""
%
locals
()
if
(
check_input
and
theano
.
config
.
check_input
):
if
(
check_input
):
print
>>
sio
,
"""
if (
%(name)
s->nd !=
%(nd)
s)
{
...
...
theano/scalar/basic.py
浏览文件 @
59fbcaee
...
...
@@ -273,7 +273,7 @@ class Scalar(Type):
def
c_extract
(
self
,
name
,
sub
,
check_input
=
True
):
specs
=
self
.
dtype_specs
()
if
(
check_input
and
theano
.
config
.
check_input
):
if
(
check_input
):
pre
=
"""
if (!PyObject_TypeCheck(py_
%(name)
s, &
%(pyarr_type)
s))
{
...
...
theano/tensor/type.py
浏览文件 @
59fbcaee
...
...
@@ -438,7 +438,7 @@ class TensorType(Type):
def
c_extract
(
self
,
name
,
sub
,
check_input
=
True
):
"""Override `CLinkerType.c_extract` """
if
(
check_input
and
theano
.
config
.
check_input
):
if
(
check_input
):
check
=
"""
%(name)
s = NULL;
if (py_
%(name)
s == Py_None) {
...
...
theano/tests/test_tutorial.py
浏览文件 @
59fbcaee
...
...
@@ -246,7 +246,7 @@ class T_extending(unittest.TestCase):
double
.
c_init
=
c_init
def
c_extract
(
name
,
sub
,
check_input
=
True
):
if
(
check_input
and
theano
.
config
.
check_input
):
if
(
check_input
):
pre
=
"""
if (!PyFloat_Check(py_
%(name)
s)) {
PyErr_SetString(PyExc_TypeError, "expected a float");
...
...
@@ -310,7 +310,7 @@ class T_extending(unittest.TestCase):
"""
%
dict
(
name
=
name
)
def
c_extract
(
self
,
name
,
sub
,
check_input
=
True
):
if
(
check_input
and
theano
.
config
.
check_input
):
if
(
check_input
):
pre
=
"""
if (!PyFloat_Check(py_
%(name)
s)) {
PyErr_SetString(PyExc_TypeError, "expected a float");
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论