MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / GetVarShape

Method GetVarShape

src/opr/impl/tensor_manip.cpp:68–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67MGB_DYN_TYPE_OBJ_FINAL_IMPL(GetVarShape);
68GetVarShape::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
80void GetVarShape::update_cached_shape() {
81 TensorShape ishp;

Callers 4

_get_var_shapeMethod · 0.80
diag_plane_subgraphFunction · 0.80
dim2valFunction · 0.80
test_getvarshapeFunction · 0.80

Calls 6

resizeMethod · 0.80
absFunction · 0.50
owner_graphMethod · 0.45
atMethod · 0.45
sizeMethod · 0.45
dtypeMethod · 0.45

Tested by 1

test_getvarshapeFunction · 0.64