提交 bb269609 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Typo fix in comment and removed useless ()

上级 16025b5f
...@@ -4,7 +4,7 @@ from theano.gof.cc import hash_from_code ...@@ -4,7 +4,7 @@ from theano.gof.cc import hash_from_code
def hash_from_ndarray(data): def hash_from_ndarray(data):
# We need to hash the shapes and strides as hash_from_code only hash # We need to hash the shapes and strides as hash_from_code only hashes
# the data buffer. Otherwise, this will cause problem with shapes like: # the data buffer. Otherwise, this will cause problem with shapes like:
# (1, 0) and (2, 0) and problem with inplace transpose. # (1, 0) and (2, 0) and problem with inplace transpose.
# We also need to add the dtype to make the distinction between # We also need to add the dtype to make the distinction between
...@@ -14,7 +14,7 @@ def hash_from_ndarray(data): ...@@ -14,7 +14,7 @@ def hash_from_ndarray(data):
# too long hash, I call it again on the concatenation of all parts. # too long hash, I call it again on the concatenation of all parts.
if not data.flags["C_CONTIGUOUS"] and not data.flags["F_CONTIGUOUS"]: if not data.flags["C_CONTIGUOUS"] and not data.flags["F_CONTIGUOUS"]:
data = numpy.ascontiguousarray(data) data = numpy.ascontiguousarray(data)
return (hash_from_code(hash_from_code(data) + return hash_from_code(hash_from_code(data) +
hash_from_code(str(data.shape)) + hash_from_code(str(data.shape)) +
hash_from_code(str(data.strides)) + hash_from_code(str(data.strides)) +
hash_from_code(str(data.dtype)))) hash_from_code(str(data.dtype)))
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论