is_scalar

Description

Verifies whether a tensor is a scalar based on its shape.

Prototype

def is_scalar(shape)

Parameters

Parameter

Description

shape

Shape of the tensor to check.

Returns

True if the tensor is a scalar; False otherwise.

Restrictions

None

Example

from tbe.common.utils import para_check 
para_check.is_scalar((1,))