Class AbstractTuple

Inheritance Relationships

Base Type

Class Documentation

class AbstractTuple : public mindspore::abstract::AbstractSequence

Class AbstractTuple describes a tuple.

Public Functions

inline explicit AbstractTuple(AbstractBasePtrList &&elements, const std::shared_ptr<AnfNodeWeakPtrList> &tuple_nodes = nullptr)

Constructor of AbstractTuple.

Parameters
  • elements[in] A list of abstracts.

  • tuple_node[in] The nodes of tuple, usually are MakeTuple CNodes or tuple ValueNodes.

inline explicit AbstractTuple(const AbstractBasePtrList &elements, const std::shared_ptr<AnfNodeWeakPtrList> &tuple_nodes = nullptr)

Constructor of AbstractTuple.

Parameters
  • elements[in] A list of abstracts.

  • tuple_node[in] The nodes of tuple, usually are MakeTuple CNodes or tuple ValueNodes.

~AbstractTuple() override = default

Destructor of AbstractTuple.

inline virtual BaseShapePtr BuildShape() const override

Build the shape of the abstract.

Note

Use this function to get the actual shape, while track shape is not enough accurate.

Returns

A pointer to the BaseShape.

inline virtual AbstractBasePtr Clone() const override

Clone an abstract from the abstract.

Returns

A pointer to the cloned abstract.

inline virtual AbstractBasePtr Broaden() const override

Broaden the abstract. It will upgrade the abstract to a higher level.

Returns

A pointer to the broadened abstract.

inline virtual AbstractBasePtr PartialBroaden() const override

Broaden abstract with constraints.

Returns

A pointer to the broadened abstract.

inline virtual AbstractBasePtr Join(const AbstractBasePtr &other) override

Combine two abstracts. If two abstracts are different, it will broaden the abstract value.

Parameters

other[in] The other abstract to be joined.

Returns

A pointer to the combined abstract.

bool ContainsAllBroadenTensors() const

Check whether all elements of the tuple are tensors.

Returns

Whether all elements of the tuple are tensors.