Create a variable node in the graph. The created variable node is not persistable. Args: name(str): the name of the variable node. var_type(core.VarDesc.VarType): the type of the variable node. shape(list): the shape of the variable node.
(self, name, var_type, shape, var_dtype)
| 5691 | return IrVarNode(self.graph.create_var_node(var_desc)) |
| 5692 | |
| 5693 | def create_var_node(self, name, var_type, shape, var_dtype): |
| 5694 | """ |
| 5695 | Create a variable node in the graph. The created variable node is |
| 5696 | not persistable. |
| 5697 | |
| 5698 | Args: |
| 5699 | name(str): the name of the variable node. |
| 5700 | var_type(core.VarDesc.VarType): the type of the variable node. |
| 5701 | shape(list): the shape of the variable node. |
| 5702 | var_dtype(core.VarDesc.VarType): the data type of the variable node. |
| 5703 | |
| 5704 | Returns: |
| 5705 | IrVarNode: the created variable node. |
| 5706 | """ |
| 5707 | |
| 5708 | var_desc = core.VarDesc(name) |
| 5709 | var_desc.set_type(var_type) |
| 5710 | var_desc.set_shape(shape) |
| 5711 | var_desc.set_dtype(var_dtype) |
| 5712 | return IrVarNode(self.graph.create_var_node(var_desc)) |
| 5713 | |
| 5714 | def create_control_dep_var(self): |
| 5715 | """ |