From 85d3ff660dc82fabc6c10db72af50f3ada117e20 Mon Sep 17 00:00:00 2001 From: pytorchbot Date: Mon, 28 Oct 2024 11:21:22 -0700 Subject: [PATCH] [ET-VK] Fix op benchmarks code generation (#6528) ## Context As title. There was a small error in the operator benchmark code generation which impacted operators which return a collection of tensors (e.g. layer norm). The issue was that the generated code would store the output `ValueRefs` in variables that shadowed class variables of the benchmark. Differential Revision: [D65071024](https://our.internmc.facebook.com/intern/diff/D65071024/) ghstack-source-id: 250448840 Pull Request resolved: https://github.com/pytorch/executorch/pull/6527 Co-authored-by: Stephen Jia --- backends/vulkan/test/op_tests/utils/gen_computegraph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/vulkan/test/op_tests/utils/gen_computegraph.py b/backends/vulkan/test/op_tests/utils/gen_computegraph.py index f6ee9c78a1..8cefb5be04 100644 --- a/backends/vulkan/test/op_tests/utils/gen_computegraph.py +++ b/backends/vulkan/test/op_tests/utils/gen_computegraph.py @@ -448,7 +448,7 @@ def set_output(self, ref: ValueRefList, include_declarations: bool = True) -> st if isinstance(ref, list): ret_str = "" for r in ref[:-1]: - ret_str += self.set_output(r) + ret_str += self.set_output(r, include_declarations) return ret_str elif ref.src_cpp_type == TENSOR_VECTOR: assert ref.is_out