提交 1a92165c authored 作者: Virgile Andreani's avatar Virgile Andreani 提交者: Ricardo Vieira

Replace deprecated tostring with tobytes

上级 fb86c460
......@@ -1847,7 +1847,7 @@ def hex_digest(x):
Returns a short, mostly hexadecimal hash of a numpy ndarray
"""
assert isinstance(x, np.ndarray)
rval = hashlib.sha256(x.tostring()).hexdigest()
rval = hashlib.sha256(x.tobytes()).hexdigest()
# hex digest must be annotated with strides to avoid collisions
# because the buffer interface only exposes the raw data, not
# any info about the semantics of how that data should be arranged
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论