refine_axis
Description
Returns a list of axes with lengths other than 1 from shape.
Prototype
def refine_axis(axis, shape)
Parameters
Parameter |
Description |
|---|---|
axis |
An int or a list of ints, for the axes. Must be within the axis range of shape. |
shape |
Shape. |
Returns
A list of axes with lengths other than 1
Restrictions
None
Example
from tbe.common.utils import shape_util shape_util.refine_axis(-1, (1, 32, 32, 3))
Return: [3].
Parent topic: Shape-related Tools