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

Method get_scale

dnn/src/common/utils.cpp:239–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237// clang-format on
238
239float megdnn::get_scale(DType dt) {
240 megdnn_assert(dt.category() == DTypeCategory::QUANTIZED);
241#define cb(_dt) \
242 if (dt.enumv() == DTypeTrait<_dt>::enumv) \
243 return dt.param<_dt>().scale;
244 MEGDNN_FOREACH_QUANTIZED_DTYPE(cb)
245 MEGDNN_FOREACH_QUANTIZED_LOWBIT_DTYPE(cb)
246 cb(::megdnn::dtype::QuantizedS1)
247#undef cb
248 megdnn_assert_internal(0);
249}
250
251bool megdnn::dtype_almost_equal(DType lhs, DType rhs) {
252 if (lhs.enumv() != rhs.enumv())

Callers 7

calc_linear_quantizedMethod · 0.45
calc_bmm_quantizedMethod · 0.45
calc_conv_quantizedMethod · 0.45
runFunction · 0.45
test_matmulFunction · 0.45
runFunction · 0.45

Calls 2

categoryMethod · 0.80
cbFunction · 0.50

Tested by 3

runFunction · 0.36
test_matmulFunction · 0.36
runFunction · 0.36