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

Class Array

src/core/include/megbrain/utils/json.h:152–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150};
151
152class Array final : public Value {
153 MGB_DYN_TYPE_OBJ_FINAL_DECL_WITH_EXPORT;
154
155 std::vector<std::shared_ptr<Value>> m_val;
156
157public:
158 MGE_WIN_DECLSPEC_FUC static std::shared_ptr<Array> make() {
159 return std::make_shared<Array>();
160 }
161
162 MGE_WIN_DECLSPEC_FUC void add(std::shared_ptr<Value> val) {
163 mgb_assert(val);
164 m_val.emplace_back(std::move(val));
165 }
166
167 MGE_WIN_DECLSPEC_FUC std::shared_ptr<Value>& operator[](size_t idx) {
168 return m_val.at(idx);
169 }
170
171 MGE_WIN_DECLSPEC_FUC void writeto(std::string& fout, int indent = 0) const override;
172
173 auto&& get_impl() { return m_val; }
174
175 auto&& get_impl() const { return m_val; }
176};
177
178class Null final : public Value {
179 MGB_DYN_TYPE_OBJ_FINAL_DECL_WITH_EXPORT;

Callers 2

dataloader.pyFile · 0.85
__init__Method · 0.85

Calls 2

makeFunction · 0.50
atMethod · 0.45

Tested by

no test coverage detected