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

Function write_header_dict

lite/example/cpp_example/npy.h:443–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441}
442
443inline std::string write_header_dict(
444 const std::string& descr, bool fortran_order,
445 const std::vector<ndarray_len_t>& shape) {
446 std::string s_fortran_order = npy::pyparse::write_boolean(fortran_order);
447 std::string shape_s = npy::pyparse::write_tuple(shape);
448
449 return "{'descr': '" + descr + "', 'fortran_order': " + s_fortran_order +
450 ", 'shape': " + shape_s + ", }";
451}
452
453inline void write_header(
454 std::ostream& out, const std::string& descr, bool fortran_order,

Callers 1

write_headerFunction · 0.70

Calls 2

write_booleanFunction · 0.70
write_tupleFunction · 0.70

Tested by

no test coverage detected