判断指定的reduce轴能否进行reduce操作。
def check_reduce_need_refine(shape, reduce_axis, keep_dims)
参数 |
说明 |
---|---|
shape |
数据shape |
recuce_axis |
reduce轴,可以是int、tuple或者list。 |
keep_dims |
bool型,是否保持轴数。 |
如果rudce轴是1,则返回False。否则返回True。
无
from tbe.common.utils import shape_util shape_util.check_reduce_need_refine((1,32,32,3), 0, True)
检查shape(1,32,32,3)是否能够被reduce,返回False。