[inductor] Add a helper for convert index_dtype to torch dtype (#149531)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/149531
Approved by: https://github.com/eellison
This commit is contained in:
Isuru Fernando
2025-03-20 15:15:55 +00:00
committed by PyTorch MergeBot
parent a703107f7b
commit b07b819912
4 changed files with 17 additions and 6 deletions

View File

@ -398,9 +398,12 @@ class SIMDKernel(Kernel[CSEVariableType], Generic[CSEVariableType]):
def dtype_to_str(self, dtype: torch.dtype) -> str:
raise NotImplementedError
def get_index_dtype_as_torch_dtype(self) -> torch.dtype:
return self.features.select_index_dtype()
@property
def index_dtype(self) -> str:
return self.dtype_to_str(self.features.select_index_dtype())
return self.dtype_to_str(self.get_index_dtype_as_torch_dtype())
def want_no_x_dim(self) -> bool:
return False