This commit is contained in:
Dun Liang 2020-04-20 17:16:06 +08:00
parent 9b51b565f7
commit 24d3fbb4c5
1 changed files with 5 additions and 5 deletions

View File

@ -250,15 +250,15 @@ for key in pjmap.keys():
if module == 'nn':
support_ops[key] = name
def raise_unspoort(name):
raise RuntimeError(f'{a.attr} is not supported in Jittor yet. We will appreciate it if you provide an implementation of {a.attr} and make pull request at https://github.com/Jittor/jittor.')
def raise_unsupport(name):
raise RuntimeError(f'{name} is not supported in Jittor yet. We will appreciate it if you provide an implementation of {a.attr} and make pull request at https://github.com/Jittor/jittor.')
def replace(a):
if hasattr(a, "attr") and a.attr in unsupport_ops:
raise_unspoort(a.attr)
raise_unsupport(a.attr)
if hasattr(a, "id") and a.id in unsupport_ops:
raise_unspoort(a.id)
raise_unsupport(a.id)
if hasattr(a, "attr"):
if a.attr in support_ops.keys(): a.attr = support_ops[a.attr]
@ -421,7 +421,7 @@ def dfs(a):
prefix = '.'.join(func[0:-1])
func_name = func[-1]
if func_name in unsupport_ops:
raise_unspoort(func_name)
raise_unsupport(func_name)
if func_name in pjmap.keys():
ags = [astunparse.unparse(ag).strip('\n') for ag in a.args]
kws = [astunparse.unparse(kw).strip('\n') for kw in a.keywords]