mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Fix compiler check for adopt so it doesn't fail for torch >= 2 but less than recent with .is_compiling()
This commit is contained in:
parent
0b5264a108
commit
e35ea733ab
@ -39,7 +39,10 @@ def _get_scalar_dtype(is_fused=None):
|
||||
|
||||
|
||||
def _is_compiling():
|
||||
return torch.compiler.is_compiling() if hasattr(torch, 'compiler') else False
|
||||
if hasattr(torch, 'compiler') and hasattr(torch.compiler, 'is_compiling'):
|
||||
return torch.compiler.is_compiling()
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def _get_value(x):
|
||||
|
Loading…
x
Reference in New Issue
Block a user