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.

Returns

The number of inputs in this CNode.

AnfNodePtr input(size_t i) const

Get the input node of the given index.

Parameters

i[in] The given index.

Returns

The input node of the given index.

std::vector<AnfNodePtr> inputs() const

Get the input nodes.

Returns

The input nodes of this CNode.

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

Set the input nodes for this CNode.

Parameters

inputs[in] Input nodes.

void add_input(const AnfNodePtr &input)

Add an input node to this CNode.

Parameters

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.

Parameters

full_name[in] The fullname_with_scope.

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

Add a new attribute to this CNode.

Parameters
  • 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.

Parameters

name[in] The name of attribute.

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

Get the attribute with the given name.

Parameters

name[in] The name of attribute.

Returns

Attribute.