| 66 | |
| 67 | MGB_DYN_TYPE_OBJ_FINAL_IMPL(GetVarShape); |
| 68 | GetVarShape::GetVarShape( |
| 69 | const VarNodeArrayView& inp, Param axis, const OperatorNodeConfig& config) |
| 70 | : Super(inp.at(0)->owner_graph(), config, "shape_of", inp), m_axis{axis} { |
| 71 | m_src_shapes.resize(inp.size()); |
| 72 | for (auto i : inp) |
| 73 | add_input({i}); |
| 74 | add_input({}, AddInputSortType::ALL); |
| 75 | add_output(None)->dtype(dtype::Int32()); |
| 76 | add_equivalence_component<PODHash<Param>>(&m_axis); |
| 77 | mgb_assert(abs(m_axis.axis) <= m_axis.MAX_NDIM); |
| 78 | } |
| 79 | |
| 80 | void GetVarShape::update_cached_shape() { |
| 81 | TensorShape ishp; |