提交 0c38416d authored 作者: Frederic's avatar Frederic

Simplify code following code review.

上级 3753bad6
...@@ -608,7 +608,7 @@ class TensorConstantSignature(tuple): ...@@ -608,7 +608,7 @@ class TensorConstantSignature(tuple):
# The following 2 lines are needede as in Python 3.3 with NumPy # The following 2 lines are needede as in Python 3.3 with NumPy
# 1.7.1, numpy.ndarray and numpy.memmap aren't hashable. # 1.7.1, numpy.ndarray and numpy.memmap aren't hashable.
if type(self._sum) is numpy.memmap: if type(self._sum) is numpy.memmap:
self._sum = numpy.asarray(self._sum).sum() self._sum = numpy.asarray(self._sum).item()
if self.has_nan and self.no_nan.mask.all(): if self.has_nan and self.no_nan.mask.all():
# In this case the sum is not properly computed by numpy. # In this case the sum is not properly computed by numpy.
self._sum = 0 self._sum = 0
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论