提交 763d3aa5 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Typo fixes

上级 a4d57432
...@@ -507,9 +507,9 @@ DeepCopyOp ...@@ -507,9 +507,9 @@ DeepCopyOp
We have an internal Op called DeepCopyOp. It is used to make sure we We have an internal Op called DeepCopyOp. It is used to make sure we
respect the user vs Theano memory region as described in the :ref:`tutorial respect the user vs Theano memory region as described in the :ref:`tutorial
<aliasing>`. Theano have a python implementation that call the object <aliasing>`. Theano has a Python implementation that calls the object's
``copy()`` or``deepcopy()`` method for Theano Type that it don't know ``copy()`` or ``deepcopy()`` method for Theano types for which it does not
how to generate c code. know how to generate C code.
You can implement c_code for this op. You register it like this: You can implement c_code for this op. You register it like this:
...@@ -517,10 +517,10 @@ You can implement c_code for this op. You register it like this: ...@@ -517,10 +517,10 @@ You can implement c_code for this op. You register it like this:
theano.compile.function_module.register_DeepCopyOp_c_code(YOUR_TYPE_CLASS, THE_C_CODE) theano.compile.function_module.register_DeepCopyOp_c_code(YOUR_TYPE_CLASS, THE_C_CODE)
In your c code, you should use %(iname)s and %(oname)s to represent In your C code, you should use %(iname)s and %(oname)s to represent
the c variable name of the DeepCopyOp input and output the C variable names of the DeepCopyOp input and output
respectively. See an example for the gpu object in the file respectively. See an example for the type ``CudaNdarrayType`` (GPU array)
`theano/sandbox/cuda/type.py`. in the file `theano/sandbox/cuda/type.py`.
Output Guard Output Guard
============ ============
......
...@@ -130,13 +130,13 @@ class AliasedMemoryError(Exception): ...@@ -130,13 +130,13 @@ class AliasedMemoryError(Exception):
### ###
def register_DeepCopyOp_c_code(typ, code): def register_DeepCopyOp_c_code(typ, code):
""" Tell DeepCopyOp how to generate c code for a Theano Type """ Tell DeepCopyOp how to generate C code for a Theano Type
:param typ: A Theano type. It must be theano class itself and not an :param typ: A Theano type. It must be the Theano class itself and not an
object of the class. instance of the class.
:param code: C code that deep copy the Theano type 'typ'. :param code: C code that deep copies the Theano type 'typ'.
use %(iname)s and %(oname)s for the input and output c Use %(iname)s and %(oname)s for the input and output C
variable name respectively. variable names respectively.
""" """
DeepCopyOp.c_codes[typ] = code DeepCopyOp.c_codes[typ] = code
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论