[FRONTEND] decorating static methods with @staticmethod (#1069)

This commit is contained in:
Nishant Sikarwar
2023-01-18 04:05:06 +05:30
committed by GitHub
parent 3f47e9aa0e
commit 7687f85ca4
4 changed files with 12 additions and 6 deletions

View File

@@ -1619,7 +1619,8 @@ class CudaUtils(object):
cls.instance = super(CudaUtils, cls).__new__(cls)
return cls.instance
def _generate_src(self):
@staticmethod
def _generate_src():
return """
#include <cuda.h>

View File

@@ -139,13 +139,16 @@ class dtype:
def is_bool(self):
return self.is_int1()
def is_void(self):
@staticmethod
def is_void():
raise RuntimeError("Not implemented")
def is_block(self):
@staticmethod
def is_block():
return False
def is_ptr(self):
@staticmethod
def is_ptr():
return False
def __eq__(self, other: dtype):

View File

@@ -157,7 +157,8 @@ class Libdevice(ExternLibrary):
super().__init__("libdevice", path)
self._symbol_groups = {}
def _extract_symbol(self, line) -> Optional[Symbol]:
@staticmethod
def _extract_symbol(line) -> Optional[Symbol]:
# Extract symbols from line in the following format:
# "define [internal] <ret_type> @<name>(<arg_types>,)"
entries = line.split("@")

View File

@@ -33,7 +33,8 @@ class MockTensor:
def __init__(self, dtype):
self.dtype = dtype
def data_ptr(self):
@staticmethod
def data_ptr():
return 0 # optimistically assumes multiple of 16