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