Skip to content

Conversation

@JackLau1222
Copy link
Collaborator

No description provided.

Graph(Graph &&rhs) = default;

private:
private:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这行不用改缩进


void RealNode::SetAction(std::string const &action) {
action_ = action;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

builder层应该不需要Set方法 直接修改变量值就可以 你看下相关代码确认下

// 添加action字段输出
if (!action_.empty()) {
info["action"] = action_;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只有一行逻辑可以不需要大括号 简化为

if (!action_.empty())
        info["action"] = action_;

// 获取更新图的配置
auto graph_config = update_graph->Dump();

std::string config_str = graph_config.dump();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该可以简化为
std::string config_str = to_string(update_graph->Dump());

return 0;
}

void RealGraph::DynamicResetNode(const bmf_sdk::JsonParam& node_config) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

接口名改成DynamicReset

// 在当前图中创建重置节点
std::vector<std::shared_ptr<RealStream>> empty_inputs;
auto reset_node = AddModule(alias, bmf_sdk::JsonParam(node_config.json_value_),
empty_inputs, "", Python, "", "", Immediate, 0);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty_inputs看起来是多余的 可以直接用{}代替

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants