【发布时间】:2021-09-18 07:47:42
【问题描述】:
为什么tf.reduce_sum() 不适用于uint8?
考虑这个例子:
>>> tf.reduce_sum(tf.ones((4, 10, 10), dtype=tf.uint8))
<tf.Tensor: shape=(), dtype=uint8, numpy=144>
>>> tf.reduce_sum(tf.ones((4, 10, 10), dtype=tf.uint16))
<tf.Tensor: shape=(), dtype=uint16, numpy=400>
有人知道这是为什么吗?
docs 没有提到与uint8 的任何不兼容。
【问题讨论】:
标签: python arrays numpy tensorflow tensor