scalar2tensor_one
Description
Converts scalar shape to [1].
Prototype
def scalar2tensor_one(shape)
Parameters
Parameter |
Description |
|---|---|
shape |
Shape. |
Returns
[1] if a scalar shape is input. Otherwise, the input is returned.
Restrictions
None
Example
from tbe.common.utils import shape_util shape1 = [] shape_util.scalar2tensor_one(shape1)
Return: [1].
Parent topic: Shape-related Tools