提交 6ef3d960 authored 作者: nouiz's avatar nouiz

Merge pull request #7 from delallea/fix_assert_import

A few typo fixes in doc
......@@ -105,20 +105,20 @@ def register_OutputGuard_c_code(type):
class OutputGuard(gof.Op):
"""
This op is used only internaly by Theano.
This op is used only internally by Theano.
Only the AddDestroyHandler optimizer tries to insert them in the graph.
This Op is declared as destructive while is not destroying
This Op is declared as destructive while it is not destroying
anything. It returns a view. This is used to prevent destruction of
the output variable of a Theano function.
the output variables of a Theano function.
There is mechanism in Theano that should prevent this, but the use
of OutputGuard add a safe guard. Maybe it is currently possible
that optimization run before the add_destroy_handler phase that
make some inplace optimization bypass this mechanism?
There is a mechanism in Theano that should prevent this, but the use
of OutputGuard adds a safeguard: it may be possible for some optimization
run before the add_destroy_handler phase to bypass this mechanism, by
making in-place optimizations.
TODO: find a current full explaination.
TODO: find a current full explanation.
"""
destroy_map = {0:[0]}
view_map = {0:[0]}
......
......@@ -352,8 +352,8 @@ class CudaNdarrayType(Type):
return ret
# Register CudaNdarrayType to the OutputGuard list of know type
# to have OutputGuard generate c code for this type
# Register CudaNdarrayType to the OutputGuard list of known types
# to have OutputGuard generate C code for this type.
theano.compile.mode.register_OutputGuard_c_code(CudaNdarrayType)
......
......@@ -326,8 +326,8 @@ class SparseType(gof.Type):
def is_valid_value(self, a):
return scipy.sparse.issparse(a) and (a.format == self.format)
# Register CudaNdarrayType to the OutputGuard list of know type
# to have OutputGuard generate c code for this type
# Register CudaNdarrayType to the OutputGuard list of known types
# to have OutputGuard generate C code for this type.
theano.compile.mode.register_OutputGuard_c_code(SparseType)
......
......@@ -910,8 +910,8 @@ class TensorType(Type):
else:
return ()
# Register CudaNdarrayType to the OutputGuard list of know type
# to have OutputGuard generate c code for this type
# Register CudaNdarrayType to the OutputGuard list of known types
# to have OutputGuard generate C code for this type.
theano.compile.mode.register_OutputGuard_c_code(TensorType)
# Easy constructors
......@@ -3467,8 +3467,8 @@ class Subtensor(Op):
def c_code_cache_version(self):
hv = self.helper_c_code_cache_version()
# If the helper_c_code_cache_version is not versionned
# We don't want to have a versioned version of this op c code
# If `helper_c_code_cache_version` is not versioned we do not want to
# have a versioned version of this op's C code.
if len(hv) == 0:
return ()
return (1, hv)
......
......@@ -53,8 +53,8 @@ class RandomStateType(gof.Type):
return False
return True
# Register CudaNdarrayType to the OutputGuard list of know type
# to have OutputGuard generate c code for this type
# Register CudaNdarrayType to the OutputGuard list of known types
# to have OutputGuard generate C code for this type.
theano.compile.mode.register_OutputGuard_c_code(RandomStateType)
random_state_type = RandomStateType()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论