From 51406100f2e63e1e2cbd1fa62c67eed05cf6a8be Mon Sep 17 00:00:00 2001 From: Justin Yip Date: Tue, 16 Apr 2024 23:38:49 -0700 Subject: [PATCH 1/2] [ET-VK][5/n] make_seq_tensor in codegen increasing sequence is very useful for development, particularly for "slicing" and "indexing" operations. Differential Revision: [D56095314](https://our.internmc.facebook.com/intern/diff/D56095314/) [ghstack-poisoned] --- .../test/op_tests/utils/codegen_base.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/backends/vulkan/test/op_tests/utils/codegen_base.py b/backends/vulkan/test/op_tests/utils/codegen_base.py index 281fccf00ca..f3b13335932 100644 --- a/backends/vulkan/test/op_tests/utils/codegen_base.py +++ b/backends/vulkan/test/op_tests/utils/codegen_base.py @@ -218,6 +218,25 @@ def generate_suite_cpp(self) -> str: return at::rand(sizes, at::device(at::kCPU).dtype(dtype)) * (high - low) + low; }} + +at::Tensor make_seq_tensor( + std::vector sizes, + at::ScalarType dtype = at::kFloat) {{ + int64_t n = 1; + for (auto size: sizes) {{ + n *= size; + }} + + std::vector values(n); + for (int i=0;i Date: Wed, 17 Apr 2024 00:11:36 -0700 Subject: [PATCH 2/2] Update on "[ET-VK][5/n] make_seq_tensor in codegen" increasing sequence is very useful for development, particularly for "slicing" and "indexing" operations. Differential Revision: [D56095314](https://our.internmc.facebook.com/intern/diff/D56095314/) [ghstack-poisoned]