Class AnfNode

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class AnfNode : public mindspore::Base

AnfNode is the basic class of the IR definition derived from Base.

Subclassed by mindspore::ANode, mindspore::CNode

Public Functions

inline AnfNode(const FuncGraphPtr &func_graph, NodeDebugInfoPtr &&debug_info)

Constructor.

Parameters
  • func_graph[in] The FuncGraph to which this AnfNode belongs.

  • debug_info[in] The debug info to be used for this AnfNode.

inline explicit AnfNode(const FuncGraphPtr &func_graph)

Constructor.

Parameters

func_graph[in] The FuncGraph to which this AnfNode belongs.

~AnfNode() override = default

Destructor.

inline virtual void accept(AnfIrVisitor*)

Use the method of the AnfIrVisitor class to process the node.

inline FuncGraphPtr func_graph() const

Obtain the FuncGraph to which this AnfNode belongs.

Returns

The FuncGraph to which this AnfNode belongs.

inline virtual void set_func_graph(const FuncGraphPtr &func_graph)

Set the FuncGraph to which this AnfNode belongs.

Parameters

func_graph[in] The input FuncGraph.

inline ScopePtr scope()

Obtain the scope namespace of this AnfNode.

Returns

The scope namespace.

inline void set_scope(const ScopePtr &scope)

Set the scope namespace of this AnfNode.

Parameters

scope[in] New scope namespace.

inline const KernelInfoDevice *kernel_info() const

Obtain device kernel program information.

Returns

Device kernel program information.

inline KernelInfoDevice *kernel_info()

Obtain device kernel program information.

Returns

Device kernel program information.

inline const KernelInfoDevicePtr &kernel_info_ptr() const

Obtain the pointer of KernelInfoDevice.

Returns

The pointer of KernelInfoDevice.

inline void set_kernel_info(const KernelInfoDevicePtr &kernel_info)

Set device kernel program information.

Parameters

kernel_info[in] New device kernel program information.

const AbstractBasePtr &abstract() const

Obtain the inferred abstract value of this AnfNode.

Returns

The inferred abstract value.

void set_abstract(const AbstractBasePtr &abs)

Set the abstract value of this AnfNode.

Parameters

abs[in] New abstract value.

inline NodeDebugInfoPtr debug_info()

Obtain the debugging information of this AnfNode.

Returns

The debugging information of this AnfNode.

inline void set_debug_info(const NodeDebugInfoPtr &debug_info)

Set the debugging information of this AnfNode.

Returns

New debugging information.

TypePtr Type() const

Obtain the type of the element in this AnfNode.

Returns

The type of the element.

BaseShapePtr Shape() const

Obtain the shape of the element in this AnfNode.

Returns

The shape of the element.

inline virtual std::size_t hash() const final

Get the hash value of this object.

Returns

The hash value.

inline virtual std::string fullname_with_scope()

Obtain detailed information about scope namespace.

Returns

Detailed information about scope namespace.

inline std::string UniqueName()

Obtain the unique name of this AnfNode.

Returns

The unique name of this AnfNode.

inline virtual std::string DebugString(int recursive_level = 1) const

Obtain the display information of this AnfNode.

Parameters

recursive_level[in] Recursion level when displayed.

Returns

Information to be displayed.

inline virtual std::string DebugString(bool recursive) const

Obtain the display information of this AnfNode.

Parameters

recursive[in] Whether to display AnfNode recursively.

Returns

Information to be displayed.

virtual std::string ToString() const override

Get the string representation of this object.

Returns

The string representation.

inline virtual void dump() const override

Export the string representation to the standard output stream.

inline std::string UniqueId()

Obtain the unique id of the debug information of this AnfNode.

Returns

Unique id.

inline std::string UniqueIdThroughCopy()

Obtain the unique id through copied traced information.

Returns

Unique id.

template<typename T>
inline void set_user_data(const std::string &key, const std::shared_ptr<T> &value)

Set user data.

Parameters
  • key[in] The key of user data.

  • value[in] The value of user data.

template<typename T>
inline void set_user_data(const std::shared_ptr<T> &value)

Set user data.

Parameters

value[in] The value of user data.

template<typename T>
inline std::shared_ptr<T> user_data(const std::string &key) const

Get user data.

Parameters

key[in] The key of user data.

Returns

Pointer to user data.

template<typename T>
inline std::shared_ptr<T> user_data() const

Set user data.

Returns

Pointer to user data.

inline bool has_user_data(const std::string &key) const

Check whether there is corresponding user data by the given key.

Parameters

key[in] The key of user data.

Returns

True if it exists, otherwise false.

template<typename T>
inline bool has_user_data() const

Check if there is user data.

Returns

True if it exists, otherwise false.

inline void CloneUserData(const AnfNodePtr &node)

Clone user data.

Parameters

node[in] Node used to copy user data.

inline bool interpret() const

Check if there is an interpret node.

Returns

True if there is an interpret node, otherwise false.

inline void set_interpret(const bool &interpret)

Whether to use interpretation.

Parameters

interpret[in] Boolean.

inline bool interpret_internal_type()

Check if there is an interpret node related to the unsupported internal type.

Returns

True if there is an interpret node related to the unsupported internal type, otherwise false.

inline void set_interpret_internal_type(const bool &interpret_internal_type)

Whether there is an interpret node with unsupported internal type.

Parameters

interpret_internal_type[in] Boolean.

inline bool interpret_special_type()

Check if there is an interpret node related to the unsupported special type.

Returns

True if there is an interpret node related to the unsupported special type, otherwise false.

inline void set_interpret_special_type(const bool &interpret_special_type)

Whether there is an interpret node with unsupported internal type.

Parameters

interpret_special_type[in] Boolean.

inline AnfNodePtr interpreted_node()

Get interpreted node.

Returns

Interpreted node.

inline void set_interpreted_node(const AnfNodePtr &node)

Set interpreted node.

Parameters

Interpreted[in] node.