| 11 | using namespace BareMetal; |
| 12 | |
| 13 | bool RelayoutKernel::IsAvailable(TContext* context) const { |
| 14 | bool ok_dtype = context->getAttrOprand("operand:0").dtype == |
| 15 | context->getAttrOprand("operand:1").dtype; |
| 16 | std::vector<size_t> shape_in = context->getAttrOprand("operand:0").shape; |
| 17 | std::vector<size_t> shape_out = context->getAttrOprand("operand:0").shape; |
| 18 | bool ok_shape = shape_in.size() == shape_out.size(); |
| 19 | for (size_t i = 0; ok_shape && i < shape_in.size(); ++i) { |
| 20 | ok_shape = ok_shape && shape_in.at(i) == shape_out.at(i); |
| 21 | } |
| 22 | return ok_dtype && ok_shape; |
| 23 | } |
| 24 | |
| 25 | //! kernel gen |
| 26 | std::string RelayoutKernel::GetKernelSymbol(TContext* context) const { |
nothing calls this directly
no test coverage detected