| 44 | } |
| 45 | |
| 46 | void OpKernelInferCache::UpdateCacheKey(KernelInferContext* ctx) { |
| 47 | auto GetSymbolOfShape = [&](const std::string& arg_name, int32_t arg_index) -> Symbol<Shape> { |
| 48 | Shape shape; |
| 49 | ctx->ShapeView4ArgNameAndIndex(arg_name, arg_index).ToShape(&shape); |
| 50 | return SymbolOf(shape); |
| 51 | }; |
| 52 | const auto& inputs = ctx->inputs(); |
| 53 | FOR_RANGE(int, i, 0, inputs.size()) { |
| 54 | const auto& arg_pair = inputs.at(i); |
| 55 | cache_key_.ibn_idx2shape_sym.at(i) = GetSymbolOfShape(arg_pair.first, arg_pair.second); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | void OpKernelInferCache::UpdateCacheValue(KernelInferContext* ctx) { |
| 60 | // TODO: make max size configurable |
no test coverage detected