下载
中文
注册

refine_axis

函数功能

从shape中获取axis对应的非1维度数值组成的列表。

函数原型

def refine_axis(axis, shape)

参数说明

参数

说明

axis

轴,可以是int类型的值或者int类型的列表。

axis必须在shape的实际维度范围内,不能越界。

shape

shape数据。

返回值说明

axis对应的非1维度数值组成的列表。

约束说明

调用示例

from tbe.common.utils import shape_util 
shape_util.refine_axis(-1, (1, 32, 32, 3)) 

返回[3]。