Class CNode

Inheritance Relationships

Base Type

Class Documentation

class CNode : public mindspore::api::AnfNode

CNode represents a compute node with a set of input nodes.

Public Functions

size_t size() const

Get the number of inputs.

返回

The number of inputs in this CNode.

AnfNodePtr input(size_t i) const

Get the input node of the given index.

参数

i[in] The given index.

返回

The input node of the given index.

std::vector<AnfNodePtr> inputs() const

Get the input nodes.

返回

The input nodes of this CNode.

void set_inputs(const std::vector<AnfNodePtr> &inputs)

Set the input nodes for this CNode.

参数

inputs[in] Input nodes.

void add_input(const AnfNodePtr &input)

Add an input node to this CNode.

参数

input[in] the input node to be added.

void set_fullname_with_scope(const std::string &full_name)

Set fullname_with_scope for this CNode.

参数

full_name[in] The fullname_with_scope.

void AddAttr(const std::string &name, const ValuePtr &attr)

Add a new attribute to this CNode.

参数
  • name[in] The name of the new attribute.

  • attr[in] The value of the new attribute.

void EraseAttr(const std::string &name)

Erase the attribute with the given name.

参数

name[in] The name of attribute.

ValuePtr GetAttr(const std::string &name) const

Get the attribute with the given name.

参数

name[in] The name of attribute.

返回

Attribute.