forked from pytorch/xla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiff_method.py
36 lines (29 loc) · 891 Bytes
/
diff_method.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import yaml
def search(list, platform):
for i in range(len(list)):
if list[i] == platform:
return True
return False
with open("xla_native_functions.yaml", "r") as stream:
try:
xla_yaml = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
print(type(xla_yaml))
xla_functions = xla_yaml['supported']
xla_functions.sort()
with open("xla_pytorch_diff.yaml", "r") as stream:
try:
totch_yaml = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
torch_functions = []
xla_not_include = []
for func in totch_yaml:
func_str = func['func']
func_name = func_str.split('(')[0]
torch_functions.append(func_name)
if(search(xla_functions, func_name) == False):
xla_not_include.append(func_name)
else:
print(func_name)