提交 4fe3a06f authored 作者: projects@lgcm's avatar projects@lgcm

misc doc fixes

上级 ae14bbcb
......@@ -29,18 +29,18 @@ class CLinkerOp(object):
given names for the inputs and outputs.
:Parameters:
`node`: Apply instance
`node` : Apply instance
WRITEME
`name`: WRITEME
`name` : 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
`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
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.
`sub`: dict of strings
`sub` : dict of strings
extra symbols defined in `CLinker` sub symbols (such as 'fail').
WRITEME
......@@ -59,18 +59,18 @@ class CLinkerOp(object):
This is a convenient place to clean up things allocated by c_code().
:Parameters:
`node`: Apply instance
`node` : Apply instance
WRITEME
`name`: WRITEME
`name` : 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
`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
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.
`sub`: dict of strings
`sub` : dict of strings
extra symbols defined in `CLinker` sub symbols (such as 'fail').
WRITEME
......@@ -225,11 +225,11 @@ class PureOp(object):
output storage. Return None.
:Parameters:
`node`: Apply instance
`node` : Apply instance
contains the symbolic inputs and outputs
`inputs`: list
`inputs` : list
sequence of inputs (immutable)
`output_storage`: list
`output_storage` : list
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
......
......@@ -8,42 +8,11 @@
# dotted names, module filenames, or package directory names.
# Alases for this option include "objects" and "values".
modules: __init__.py,
a*,
b*,
c*,
d*,
e*,
f*,
g*,
h*,
i*,
j*,
k*,
l*,
m*,
n*,
o*,
p*,
q*,
r*,
s*,
t*,
u*
v*
w*
x*
y*
z*
[a-z]*.py,
[A-Z]*.py,
gof/__init__.py,
gof/[a-z]*,
gof/[A-Z]*,
gof/e*,
gof/g*,
gof/l*,
gof/o*,
gof/p*,
gof/t*,
gof/u*
gof/[a-z]*.py,
gof/[A-Z]*.py
# The type of output that should be generated. Should be one
# of: html, text, latex, dvi, ps, pdf.
......
......@@ -493,8 +493,15 @@ def _elemwise(scalar_op, name):
straight = elemwise.Elemwise(scalar_op, name = name)
inplace_scalar_op = scalar_op.__class__(scal.transfer_type(0))
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
_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
......@@ -542,14 +549,33 @@ def cast(t, dtype):
'complex128': convert_to_complex128}
return mapping[dtype](t)
convert_to_int8 = elemwise.Elemwise(scal.Identity(scal.specific_out(scal.int8)))
convert_to_int16 = elemwise.Elemwise(scal.Identity(scal.specific_out(scal.int16)))
convert_to_int32 = elemwise.Elemwise(scal.Identity(scal.specific_out(scal.int32)))
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_float64 = elemwise.Elemwise(scal.Identity(scal.specific_out(scal.float64)))
convert_to_complex64 = elemwise.Elemwise(scal.Identity(scal.specific_out(scal.complex64)))
convert_to_complex128 = elemwise.Elemwise(scal.Identity(scal.specific_out(scal.complex128)))
def _conversion(f):
f.__module__ = 'tensor'
return f
convert_to_int8 = _conversion(elemwise.Elemwise(scal.Identity(scal.specific_out(scal.int8))))
"""Cast to 8-bit integer"""
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论