提交 061548c0 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Typo fixes

上级 07bf16ce
...@@ -366,8 +366,8 @@ def constant_or_value(x, rtype, name=None, ndim=None, dtype=None): ...@@ -366,8 +366,8 @@ def constant_or_value(x, rtype, name=None, ndim=None, dtype=None):
# Theano graph, because on Windows 64, all shapes are expressed # Theano graph, because on Windows 64, all shapes are expressed
# with longs. # with longs.
# If a long fits in int64, we convert it into an int64, like # If a long fits in int64, we convert it into an int64, like
# numpy.asarray() does up to 1.7. NumPy 1.7.1 upcaset to int64 # numpy.asarray() does up to 1.7. NumPy 1.7.1 upcasts to int64
# if possible, but fallback to uint64 if int64 isn't possible but # if possible, but falls back to uint64 if int64 isn't possible but
# uint64 is. We always do as NumPy 1.7.1 here. # uint64 is. We always do as NumPy 1.7.1 here.
# If x is too big, an OverflowError will be raised by numpy. # If x is too big, an OverflowError will be raised by numpy.
try: try:
...@@ -382,10 +382,10 @@ def constant_or_value(x, rtype, name=None, ndim=None, dtype=None): ...@@ -382,10 +382,10 @@ def constant_or_value(x, rtype, name=None, ndim=None, dtype=None):
if x.dtype == 'bool': if x.dtype == 'bool':
x_ = numpy.asarray(x_, dtype='uint8') x_ = numpy.asarray(x_, dtype='uint8')
else: else:
# Here x is probably a list or a tuple. If it contain a long, # Here x is probably a list or a tuple. If it contains a long,
# we will behave like the current NumPy version: 1.7 and bellow, # we will behave like the current NumPy version: 1.7 and below,
# it will only work if the long fit in int64. For NumPy 1.7.1+, # it will only work if the long fits in int64. For NumPy 1.7.1+,
# it will work if the long git in int64 or uint64. # it will work if the long fits in int64 or uint64.
x_ = numpy.asarray(x) x_ = numpy.asarray(x)
assert type(x_) == numpy.ndarray assert type(x_) == numpy.ndarray
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论