| 83 | } // namespace |
| 84 | |
| 85 | bool ConvBackDataGeneral::IsAvailable(TContext* ctx) const { |
| 86 | bool param_mode_ok = (ctx->getAttrStr("format") == "NCHW" || |
| 87 | ctx->getAttrStr("format") == "NCHW44") && |
| 88 | ctx->getAttrStr("mode") == "CROSS_CORRELATION"; |
| 89 | bool type_float_ok = ctx->getAttrInt("nr_operands") == 3 && |
| 90 | ((ctx->getAttrOprand("operand:0").dtype == "f32" && |
| 91 | ctx->getAttrOprand("operand:1").dtype == "f32" && |
| 92 | ctx->getAttrOprand("operand:2").dtype == "f32")); |
| 93 | bool type_qint_ok = |
| 94 | ctx->getAttrInt("nr_operands") == 3 && |
| 95 | (Utils::is_quant_dtype(ctx->getAttrOprand("operand:0").dtype, 8) && |
| 96 | Utils::is_quant_dtype(ctx->getAttrOprand("operand:1").dtype, 8) && |
| 97 | Utils::is_quant_dtype(ctx->getAttrOprand("operand:2").dtype, 8)); |
| 98 | |
| 99 | return param_mode_ok && (type_float_ok || type_qint_ok); |
| 100 | } |
| 101 | |
| 102 | std::string ConvBackDataGeneral::GetKernelSymbol(TContext* ctx) const { |
| 103 | std::stringstream extra_ss; |
nothing calls this directly
no test coverage detected