未验证 提交 d9884e20 编写于 作者: Z zyfncg 提交者: GitHub

adjust the args checking of backward in yaml (#40091)

上级 909d1e61
...@@ -56,8 +56,9 @@ class BackwardAPI(BaseAPI): ...@@ -56,8 +56,9 @@ class BackwardAPI(BaseAPI):
# check the attributes of backward # check the attributes of backward
for attr in self.attrs['names']: for attr in self.attrs['names']:
assert attr in fw_attrs['names'] and self.attrs['attr_info'][attr][0] == fw_attrs['attr_info'][attr][0], \ assert (attr in fw_attrs['names'] and self.attrs['attr_info'][attr][0] == fw_attrs['attr_info'][attr][0]) or \
f"{self.api} : Attribute error: The attribute({attr}) of backward isn't consistent with forward api. \ self.attrs['attr_info'][attr][1] is not None, \
f"{self.api} : Attribute error: The attribute({attr}) of backward isn't consistent with forward api or doesn't have default value. \
Please check the args of {self.api} in yaml." Please check the args of {self.api} in yaml."
# check the output of backward # check the output of backward
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册