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

Function is_fbs_file

src/serialization/impl/serializer_oss_common.cpp:8–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace serialization {
7
8bool is_fbs_file(InputFile& file) {
9 //! check whether the model format is flatbuffer v2
10 uint64_t magic_with_reserved = 0;
11 file.read(&magic_with_reserved, sizeof(magic_with_reserved));
12 file.skip(-sizeof(magic_with_reserved));
13 return (magic_with_reserved == MGB_MAGIC) || (magic_with_reserved == MAGIC_V0);
14}
15
16void check_tensor_value_valid(const std::string& name, const HostTensorND& tensor) {
17 bool cond_normal = tensor.layout().format.is_default() &&

Callers 1

Calls 2

readMethod · 0.45
skipMethod · 0.45

Tested by

no test coverage detected