From 3fa77fa51ac3cf627c86d0aa1fdbb71e1a922db2 Mon Sep 17 00:00:00 2001 From: Mike Iovine Date: Wed, 27 Apr 2022 09:32:27 -0700 Subject: [PATCH] [SR] Fix quantized linear tests not managing outputs (#75776) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/75776 The output was returned directly instead of a clone, so the output of the relevant op would not be managed. ghstack-source-id: 154935103 Test Plan: CI Reviewed By: navahgar Differential Revision: D35633469 fbshipit-source-id: 7b08b7368e0349a12abf8802a4c625ffecdc5abb (cherry picked from commit 24bed9ba4da39cff7f3b40f5e49dfded2552b373) --- benchmarks/static_runtime/test_static_runtime.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/static_runtime/test_static_runtime.cc b/benchmarks/static_runtime/test_static_runtime.cc index 55585193d94..41c7dfd9e73 100644 --- a/benchmarks/static_runtime/test_static_runtime.cc +++ b/benchmarks/static_runtime/test_static_runtime.cc @@ -2133,7 +2133,7 @@ TEST(StaticRuntime, QuantizedLinearDynamicFp16) { %packed_params = quantized::linear_prepack_fp16(%weights, %bias) %output = quantized::linear_dynamic_fp16(%input, %packed_params) %ret = aten::clone(%output, %bias) - return (%output) + return (%ret) )IR"; at::Tensor weight = torch::randn({3, 2}, torch::kFloat); at::Tensor input = torch::randn({3, 2}, torch::kFloat); @@ -2154,7 +2154,7 @@ TEST(StaticRuntime, QuantizedLinearReluDynamicFp16) { %packed_params = quantized::linear_prepack_fp16(%weights, %bias) %output = quantized::linear_relu_dynamic_fp16(%input, %packed_params) %ret = aten::clone(%output, %bias) - return (%output) + return (%ret) )IR"; at::Tensor weight = torch::randn({3, 2}, torch::kFloat); at::Tensor input = torch::randn({3, 2}, torch::kFloat);