Skip to content

Commit 4273e5d

Browse files
FFFrogpytorchmergebot
authored andcommitted
Expose is_available API for torch.backends.mkldnn (pytorch#147432)
As the title stated. Like torch.backends.mkl, torch.backends.openmp and so on, they all expose is_available API for users. Pull Request resolved: pytorch#147432 Approved by: https://github.com/albanD
1 parent 1a1a32c commit 4273e5d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

torch/backends/mkldnn/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ class MkldnnModule(PropModule):
9494
def __init__(self, m, name):
9595
super().__init__(m, name)
9696

97+
def is_available(self):
98+
return is_available()
99+
97100
enabled = ContextProp(torch._C._get_mkldnn_enabled, torch._C._set_mkldnn_enabled)
98101
deterministic = ContextProp(
99102
torch._C._get_mkldnn_deterministic, torch._C._set_mkldnn_deterministic

0 commit comments

Comments
 (0)