junrushao1994 commented on a change in pull request #9764:
URL: https://github.com/apache/tvm/pull/9764#discussion_r771887839



##########
File path: src/te/operation/create_primfunc.cc
##########
@@ -144,7 +145,30 @@ BlockRealize GenerateBlockFromTensor(const te::ComputeOp& 
compute_op, const te::
   }
 
   // Step 6. Add script_parsing_detect_access attr for auto complete the whole 
IR.
-  Map<String, ObjectRef> annotations = compute_op->attrs;
+  Map<String, ObjectRef> annotations;
+  auto mutate_attr = [&info](const ObjectRef& value) -> ObjectRef {
+    if (value->IsInstance<te::TensorNode>()) {
+      const auto& tensor_value = Downcast<te::Tensor>(value);
+      auto it = info->tensor2buffers.find(tensor_value);
+      ICHECK(it != info->tensor2buffers.end());
+      return it->second;

Review comment:
       ```suggestion
       if (const auto* tensor_value = value.as<te::TensorNode>()) {
         return info->tensor2buffers.at(GetRef<te::Tensor>(tensor_value));
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to