| 109 | } |
| 110 | |
| 111 | std::string get_graph_color(const instruction_ref& ins) |
| 112 | { |
| 113 | const auto& op = ins->get_operator(); |
| 114 | const auto& attr = op.attributes(); |
| 115 | |
| 116 | bool context_free = is_context_free(op); |
| 117 | bool alias = not op.output_alias(to_shapes(ins->inputs())).empty(); |
| 118 | |
| 119 | if(ins->can_eval()) |
| 120 | { |
| 121 | return "#ADD8E6"; // lightblue |
| 122 | } |
| 123 | else if(attr.contains("pointwise")) |
| 124 | { |
| 125 | return "#9ACD32"; // yellowgreen |
| 126 | } |
| 127 | else if(starts_with(op.name(), "reduce")) |
| 128 | { |
| 129 | return "#90EE90"; // light green |
| 130 | } |
| 131 | else if(context_free and alias) |
| 132 | { |
| 133 | return "#98FB98"; // palegreen |
| 134 | } |
| 135 | else if(context_free and not alias) |
| 136 | { |
| 137 | return "#FFA500"; // orange |
| 138 | } |
| 139 | else if(not context_free and alias) |
| 140 | { |
| 141 | return "#EFBF04"; // gold |
| 142 | } |
| 143 | else if(attr.contains("fillcolor")) |
| 144 | { |
| 145 | return attr.at("fillcolor").to<std::string>(); |
| 146 | } |
| 147 | else |
| 148 | { |
| 149 | return "#D3D3D3"; // lightgray |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | graphviz_node_content get_node_content(const instruction_ref& ins) |
| 154 | { |
no test coverage detected