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

Method get_scale

src/tensorrt/impl/opr_replace.cpp:1304–1318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1302}
1303
1304float TensorRTReplacePass::Impl::get_scale(DType data_type) {
1305 float scale = 1.f;
1306#define cb(_dt) \
1307 case DTypeTrait<_dt>::enumv: \
1308 scale = data_type.param<_dt>().scale; \
1309 break;
1310 switch (data_type.enumv()) {
1311 MEGDNN_FOREACH_QUANTIZED_DTYPE(cb);
1312 default:
1313 mgb_throw(
1314 InternalError, "invalid quantized data type: %s", data_type.name());
1315 }
1316 return scale;
1317#undef cb
1318}
1319
1320bool TensorRTReplacePass::Impl::is_quantized_int8_operator(OperatorNodeBase* opr) {
1321 bool is_quantized = true;

Callers

nothing calls this directly

Calls 2

enumvMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected