From 56d073939d1d6330bac2d8e813508eb273fe38c3 Mon Sep 17 00:00:00 2001 From: Siva Date: Mon, 30 Dec 2024 21:13:42 +0530 Subject: [PATCH] test case fix --- python/tvm/runtime/ndarray.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/python/tvm/runtime/ndarray.py b/python/tvm/runtime/ndarray.py index 082a28c7e204..ebfbf3347be3 100644 --- a/python/tvm/runtime/ndarray.py +++ b/python/tvm/runtime/ndarray.py @@ -288,7 +288,13 @@ def copyto(self, target, mem_scope=None): return self._copyto(res) raise ValueError(f"Unsupported target type {type(target)}") - def _create_view(self, shape, dtype: Optional[str] = None, relative_byte_offset: int = 0): + def _create_view( + self, + shape, + dtype: Optional[str] = None, + relative_byte_offset: int = 0, + scope: str = "global", + ): """Create a view into an existing array. The view shares the same allocation and datatype as the @@ -325,6 +331,9 @@ def _create_view(self, shape, dtype: Optional[str] = None, relative_byte_offset: start of the backing allocation, while the `relative_byte_offset` is relative to the start of `self`. + scope: str + Memory scope of the requesting view + """ if not isinstance(shape, tvm.runtime.ShapeTuple): @@ -333,7 +342,7 @@ def _create_view(self, shape, dtype: Optional[str] = None, relative_byte_offset: if dtype is None: dtype = self.dtype - return _ffi_api.TVMArrayCreateView(self, shape, dtype, relative_byte_offset) + return _ffi_api.TVMArrayCreateView(self, shape, dtype, relative_byte_offset, scope) def device(dev_type, dev_id=0):