| 53 | } // namespace |
| 54 | |
| 55 | bool ElemwiseMultiTypeKernel::IsAvailable(TContext* context) const { |
| 56 | auto mode = context->getAttrStr("mode"); |
| 57 | auto nr_operands = context->getAttrInt("nr_operands"); |
| 58 | bool nr_operands_ok = nr_operands == 2 || nr_operands == 3; |
| 59 | bool mode_ok_unary = nr_operands == 2 && mode == "QRELU"; |
| 60 | bool mode_ok_binary = |
| 61 | nr_operands == 3 && (mode == "QADD" || mode == "QFUSE_ADD_RELU"); |
| 62 | return nr_operands_ok && (mode_ok_unary || mode_ok_binary); |
| 63 | } |
| 64 | |
| 65 | std::string ElemwiseMultiTypeKernel::GetKernelSymbol(TContext* context) const { |
| 66 | std::stringstream ss; |
nothing calls this directly
no test coverage detected