| 227 | } |
| 228 | |
| 229 | auto is_same_st(const OpDef& def, const OpDef& another) { |
| 230 | if (!another.same_type<ShapeInfer>()) { |
| 231 | return false; |
| 232 | } |
| 233 | auto& lhs = def.cast_final_safe<ShapeInfer>(); |
| 234 | auto& rhs = another.cast_final_safe<ShapeInfer>(); |
| 235 | if (!lhs.op->is_same(*rhs.op)) { |
| 236 | return false; |
| 237 | } |
| 238 | return std::tie(lhs.devices, lhs.dtypes) == std::tie(rhs.devices, rhs.dtypes); |
| 239 | } |
| 240 | |
| 241 | OP_TRAIT_REG(ShapeInfer, ShapeInfer) |
| 242 | .apply_on_var_node(apply_on_var_node) |