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

Function print_host_val

src/plugin/impl/opr_io_dump.cpp:96–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94};
95
96void print_host_val(
97 FILE* fout, size_t max_nr_print, const megdnn::TensorND& val,
98 bool print_stat = false) {
99 switch (val.layout.dtype.enumv()) {
100#define cb(_dt) \
101 case DTypeTrait<_dt>::enumv: \
102 return do_print_host_val<DTypeTrait<_dt>::ctype>( \
103 fout, max_nr_print, val, print_stat);
104 MEGDNN_FOREACH_COMPUTING_DTYPE(cb)
105 MEGDNN_FOREACH_QUANTIZED_DTYPE(cb)
106 MEGDNN_FOREACH_QUANTIZED_LOWBIT_DTYPE(cb)
107 cb(dtype::Bool) cb(::megdnn::dtype::QuantizedS1) cb(dtype::Uint16)
108#undef cb
109 default : mgb_throw(
110 MegBrainError,
111 "can not handle dtype %s in "
112 "print_host_val",
113 val.layout.dtype.name());
114 }
115};
116
117} // anonymous namespace
118

Callers 2

flushMethod · 0.85
dump_varMethod · 0.85

Calls 3

cbFunction · 0.50
enumvMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected