mehrdadh commented on code in PR #11065:
URL: https://github.com/apache/tvm/pull/11065#discussion_r855542579


##########
python/tvm/contrib/hexagon/session.py:
##########
@@ -95,6 +94,25 @@ def __enter__(self):
     def __exit__(self, exc_type, exc_value, exc_traceback):
         pass
 
+    @property
+    def device(self):
+        """Session device."""
+
+        if hasattr(self, "_device") and self._device is not None:

Review Comment:
   done.



##########
python/tvm/contrib/hexagon/session.py:
##########
@@ -226,6 +244,28 @@ def get_executor_from_factory(self, module: 
ExecutorFactoryModule):
 
         raise TypeError(f"Unsupported executor type: {type(module)}")
 
+    def set_device_type(self, module: Union[str, pathlib.Path, 
GraphExecutorFactoryModule]):

Review Comment:
   done.



##########
python/tvm/contrib/hexagon/session.py:
##########
@@ -95,6 +94,25 @@ def __enter__(self):
     def __exit__(self, exc_type, exc_value, exc_traceback):
         pass
 
+    @property
+    def device(self):
+        """Session device."""
+
+        if hasattr(self, "_device") and self._device is not None:
+            return self._device
+
+        if not hasattr(self, "_requires_cpu_device"):
+            assert (
+                False
+            ), "Device type is not set. 'set_device_type' should be called 
before accessing device."

Review Comment:
   changed set_device_type to be an internal function and removed the assert 
since it has default value now.



##########
python/tvm/contrib/hexagon/session.py:
##########
@@ -95,6 +94,25 @@ def __enter__(self):
     def __exit__(self, exc_type, exc_value, exc_traceback):
         pass
 
+    @property
+    def device(self):
+        """Session device."""
+
+        if hasattr(self, "_device") and self._device is not None:
+            return self._device
+
+        if not hasattr(self, "_requires_cpu_device"):

Review Comment:
   makes sense, added the default and changed set_device_type to be an internal 
function.



-- 
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