Class BinaryOprIODump

Inheritance Relationships

Base Type

Class Documentation

class mgb::BinaryOprIODump : public mgb::OprIODumpBase

similar to TextOprIODump, but write to binary files in a directory

The output directory must exist. An environment var MGB_DUMP_INPUT can be set to also dump the input values accessed by each opr.

The files can be parsed by the megbrain.plugin.load_tensor_binary python function.

Public Functions

BinaryOprIODump(cg::ComputingGraph *graph, std::string output_dir)
~BinaryOprIODump()
void flush_lazy() override

write lazy values due to comp_node_seq_record_level to file

Note: this is only effective when comp_node_seq_record_level is set. If compiled func is executed again without calling flush_lazy(), then previously recorded values would be overwritten and nothing would be recorded to file.