[XPU] fallback to native implementation for xpu custom op (#7670)

This commit is contained in:
jianyizh 2024-08-20 15:26:09 +08:00 committed by GitHub
parent c4be16e1a7
commit e6d811dd13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,9 @@ class CustomOp(nn.Module):
return self.forward_cuda(*args, **kwargs)
def forward_xpu(self, *args, **kwargs):
raise NotImplementedError
# By default, we assume that XPU ops are compatible with the
# PyTorch-native implementation.
return self.forward_native(*args, **kwargs)
def forward_cpu(self, *args, **kwargs):
# By default, we assume that CPU ops are compatible with CUDA ops.