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

Method __call__

dnn/scripts/gen_param_defs.py:885–905  ·  view source on GitHub ↗
(self, fout, defs)

Source from the content-addressed store, hash-verified

883 )
884
885 def __call__(self, fout, defs):
886 super().__call__(fout)
887 self._write("// %s", self._get_header())
888 self._write(
889 "// this file can only be included in "
890 "megbrain/src/plugin/impl/opr_footprint.cpp\n"
891 "// please do not include it directly"
892 )
893 self._write('#include "megdnn/opr_param_defs.h"')
894 self._write("#pragma once")
895 self._write("using namespace megdnn;")
896 self._write("namespace mgb {")
897 self._write("namespace opr {")
898 self._write("template<class OprParam>")
899 self._write(
900 "std::shared_ptr<mgb::json::Value> opr_param_to_json(const OprParam &param);"
901 )
902 self._process(defs)
903 self._write("} // namespace opr")
904 self._write("} // namespace mgb")
905 self._write("\n// vim: syntax=cpp.doxygen")
906
907 def _on_param_begin(self, p):
908 self._write("template<>", indent=0)

Callers

nothing calls this directly

Calls 4

_writeMethod · 0.80
_get_headerMethod · 0.80
_processMethod · 0.80
__call__Method · 0.45

Tested by

no test coverage detected