Commit 59172ff6 authored by Yu Cheng's avatar Yu Cheng Committed by LeiWang1999
Browse files

[Refactor] Improve dtype handling in KernelParam class (#564)

- Updated the dtype handling logic in the KernelParam class to enhance clarity and maintainability. The dtype string is now modified only if it starts with "torch.", simplifying the return statement for boolean type checks.
parent e7b97be2
...@@ -97,7 +97,9 @@ class KernelParam: ...@@ -97,7 +97,9 @@ class KernelParam:
bool: True if parameter is a boolean type, False otherwise bool: True if parameter is a boolean type, False otherwise
""" """
dtype_str = str(self.dtype) dtype_str = str(self.dtype)
return dtype_str[6:] if dtype_str.startswith("torch.") else dtype_str.startswith("bool") if dtype_str.startswith("torch."):
dtype_str = dtype_str[6:]
return dtype_str.startswith("bool")
@dataclass @dataclass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment