Class Shape

Inheritance Relationships

Base Type

Class Documentation

class Shape : public mindspore::abstract::BaseShape

Shape defines dimensions of tensor.

Public Functions

inline Shape()

Constructor of Shape.

inline Shape(const std::initializer_list<int64_t> &list)

Constructor of Shape.

Parameters

list[in] Initial shape dimensions.

inline explicit Shape(const ShapeVector &list)

Constructor of Shape.

Parameters

list[in] Initial shape dimensions.

inline Shape(const ShapeVector &list, const ShapeVector &min_shape, const ShapeVector &max_shape)

Constructor of Shape.

Parameters
  • list[in] Initial shape dimensions.

  • min_shape[in] Minimum shape dimensions of dynamic shape.

  • max_shape[in] Maximum shape dimensions of dynamic shape.

~Shape() override = default

Destructor of Shape.

virtual MS_DECLARE_PARENT(Shape, BaseShape) std std::string DumpText () const override

Calculate the hash value for Shape.

Get the description string about the Shape object.

Get the debug information about the Shape object.

Returns

The hash value of Shape.

Returns

The description string about the Shape object.

Returns

The debug information about the Shape object.

inline virtual BaseShapePtr Clone() const override

Clone a new object by this one.

Returns

New cloned object.

virtual void Broaden() override

Broaden the shape.

inline void set_shape(const ShapeVector &shape)

Set shape dimensions of Shape object.

Parameters

shape[in] Dimensions of shape.

inline const ShapeVector &shape() const

Get shape dimensions.

Returns

Shape dimensions.

inline const ShapeVector &min_shape() const

Get minimum shape dimensions.

Returns

Minimum shape dimensions.

inline const ShapeVector &max_shape() const

Get maximum shape dimensions.

Returns

Maximum shape dimensions.

inline virtual bool IsDynamic() const override

Whether the object’s dimensions are dynamic.

Returns

True if the object’s dimensions are dynamic, otherwise false.

inline virtual bool IsDimZero() const override

Whether the object’s dimension is zero.

Returns

True if the object’s dimension is zero, otherwise false.

inline virtual bool IsDimUnknown() const override

Whether the object’s dimensions are unknown.

Returns

True if the object’s dimensions are unknown, otherwise false.