operator==

Description

Determines whether a shape object is equal to another shape object. If dim num of the two shape objects is the same and each dim value in dim num is the same, the two shape objects are equal.

Prototype

bool operator==(const Shape &rht) const

Parameters

Parameter

Input/Output

Description

rht

Input

Another shape object.

Returns

true: equal; false: not equal

Restrictions

None.

Example

Shape shape0({3, 256, 256});
Shape shape1({1, 3, 256, 256});
auto is_same_shape = shape0 == shape1; // false is returned, indicating that the two shapes are not equal.