Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4fe3a06f
提交
4fe3a06f
authored
9月 24, 2008
作者:
projects@lgcm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
misc doc fixes
上级
ae14bbcb
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
52 行增加
和
57 行删除
+52
-57
op.py
gof/op.py
+13
-13
local.epydoc
local.epydoc
+4
-35
tensor.py
tensor.py
+35
-9
没有找到文件。
gof/op.py
浏览文件 @
4fe3a06f
...
@@ -29,18 +29,18 @@ class CLinkerOp(object):
...
@@ -29,18 +29,18 @@ class CLinkerOp(object):
given names for the inputs and outputs.
given names for the inputs and outputs.
:Parameters:
:Parameters:
`node`: Apply instance
`node`
: Apply instance
WRITEME
WRITEME
`name`: WRITEME
`name`
: WRITEME
WRITEME
WRITEME
`inputs`: list of strings
`inputs`
: list of strings
There is a string for each input of the function, and the string is the name of a C
There is a string for each input of the function, and the string is the name of a C
`PyObject` variable pointing to that input.
`PyObject` variable pointing to that input.
`outputs`: list of strings
`outputs`
: list of strings
Each string is the name of a `PyObject` pointer where the Op should store its
Each string is the name of a `PyObject` pointer where the Op should store its
results. The `CLinker` guarantees that on entry to this code block, each pointer
results. The `CLinker` guarantees that on entry to this code block, each pointer
is either NULL or is unchanged from the end of the previous execution.
is either NULL or is unchanged from the end of the previous execution.
`sub`: dict of strings
`sub`
: dict of strings
extra symbols defined in `CLinker` sub symbols (such as 'fail').
extra symbols defined in `CLinker` sub symbols (such as 'fail').
WRITEME
WRITEME
...
@@ -59,18 +59,18 @@ class CLinkerOp(object):
...
@@ -59,18 +59,18 @@ class CLinkerOp(object):
This is a convenient place to clean up things allocated by c_code().
This is a convenient place to clean up things allocated by c_code().
:Parameters:
:Parameters:
`node`: Apply instance
`node`
: Apply instance
WRITEME
WRITEME
`name`: WRITEME
`name`
: WRITEME
WRITEME
WRITEME
`inputs`: list of strings
`inputs`
: list of strings
There is a string for each input of the function, and the string is the name of a C
There is a string for each input of the function, and the string is the name of a C
`PyObject` variable pointing to that input.
`PyObject` variable pointing to that input.
`outputs`: list of strings
`outputs`
: list of strings
Each string is the name of a `PyObject` pointer where the Op should store its
Each string is the name of a `PyObject` pointer where the Op should store its
results. The `CLinker` guarantees that on entry to this code block, each pointer
results. The `CLinker` guarantees that on entry to this code block, each pointer
is either NULL or is unchanged from the end of the previous execution.
is either NULL or is unchanged from the end of the previous execution.
`sub`: dict of strings
`sub`
: dict of strings
extra symbols defined in `CLinker` sub symbols (such as 'fail').
extra symbols defined in `CLinker` sub symbols (such as 'fail').
WRITEME
WRITEME
...
@@ -225,11 +225,11 @@ class PureOp(object):
...
@@ -225,11 +225,11 @@ class PureOp(object):
output storage. Return None.
output storage. Return None.
:Parameters:
:Parameters:
`node`: Apply instance
`node`
: Apply instance
contains the symbolic inputs and outputs
contains the symbolic inputs and outputs
`inputs`: list
`inputs`
: list
sequence of inputs (immutable)
sequence of inputs (immutable)
`output_storage`: list
`output_storage`
: list
list of mutable 1-element lists (do not change the length of these lists)
list of mutable 1-element lists (do not change the length of these lists)
The `output_storage` list might contain data. If an element of
The `output_storage` list might contain data. If an element of
...
...
local.epydoc
浏览文件 @
4fe3a06f
...
@@ -8,42 +8,11 @@
...
@@ -8,42 +8,11 @@
# dotted names, module filenames, or package directory names.
# dotted names, module filenames, or package directory names.
# Alases for this option include "objects" and "values".
# Alases for this option include "objects" and "values".
modules: __init__.py,
modules: __init__.py,
a*,
[a-z]*.py,
b*,
[A-Z]*.py,
c*,
d*,
e*,
f*,
g*,
h*,
i*,
j*,
k*,
l*,
m*,
n*,
o*,
p*,
q*,
r*,
s*,
t*,
u*
v*
w*
x*
y*
z*
gof/__init__.py,
gof/__init__.py,
gof/[a-z]*,
gof/[a-z]*.py,
gof/[A-Z]*,
gof/[A-Z]*.py
gof/e*,
gof/g*,
gof/l*,
gof/o*,
gof/p*,
gof/t*,
gof/u*
# The type of output that should be generated. Should be one
# The type of output that should be generated. Should be one
# of: html, text, latex, dvi, ps, pdf.
# of: html, text, latex, dvi, ps, pdf.
...
...
tensor.py
浏览文件 @
4fe3a06f
...
@@ -493,8 +493,15 @@ def _elemwise(scalar_op, name):
...
@@ -493,8 +493,15 @@ def _elemwise(scalar_op, name):
straight
=
elemwise
.
Elemwise
(
scalar_op
,
name
=
name
)
straight
=
elemwise
.
Elemwise
(
scalar_op
,
name
=
name
)
inplace_scalar_op
=
scalar_op
.
__class__
(
scal
.
transfer_type
(
0
))
inplace_scalar_op
=
scalar_op
.
__class__
(
scal
.
transfer_type
(
0
))
inplace
=
elemwise
.
Elemwise
(
inplace_scalar_op
,
{
0
:
0
},
name
=
name
+
"_inplace"
)
inplace
=
elemwise
.
Elemwise
(
inplace_scalar_op
,
{
0
:
0
},
name
=
name
+
"_inplace"
)
_constructor_list
.
append
(
straight
)
# don't add the inplace versions, they aren't supposed to be part of the user interface
# don't add the inplace versions, they aren't supposed to be part of the user interface
_constructor_list
.
append
(
straight
)
# This is here so that gen_oplist can detect which module declared these variables.
straight
.
__module__
=
'tensor'
inplace
.
__module__
=
'tensor'
return
straight
,
inplace
return
straight
,
inplace
...
@@ -542,14 +549,33 @@ def cast(t, dtype):
...
@@ -542,14 +549,33 @@ def cast(t, dtype):
'complex128'
:
convert_to_complex128
}
'complex128'
:
convert_to_complex128
}
return
mapping
[
dtype
](
t
)
return
mapping
[
dtype
](
t
)
convert_to_int8
=
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
int8
)))
def
_conversion
(
f
):
convert_to_int16
=
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
int16
)))
f
.
__module__
=
'tensor'
convert_to_int32
=
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
int32
)))
return
f
convert_to_int64
=
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
int64
)))
convert_to_float32
=
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
float32
)))
convert_to_int8
=
_conversion
(
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
int8
))))
convert_to_float64
=
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
float64
)))
"""Cast to 8-bit integer"""
convert_to_complex64
=
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
complex64
)))
convert_to_complex128
=
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
complex128
)))
convert_to_int16
=
_conversion
(
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
int16
))))
"""Cast to 16-bit integer"""
convert_to_int32
=
_conversion
(
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
int32
))))
"""Cast to 32-bit integer"""
convert_to_int64
=
_conversion
(
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
int64
))))
"""Cast to 64-bit integer"""
convert_to_float32
=
_conversion
(
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
float32
))))
"""Cast to single-precision floating point"""
convert_to_float64
=
_conversion
(
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
float64
))))
"""Cast to double-precision floating point"""
convert_to_complex64
=
_conversion
(
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
complex64
))))
"""Cast to single-precision complex"""
convert_to_complex128
=
_conversion
(
elemwise
.
Elemwise
(
scal
.
Identity
(
scal
.
specific_out
(
scal
.
complex128
))))
"""Cast to double-precision complex"""
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论