未验证 提交 e6c5282e 编写于 作者: J Jiangxinz 提交者: GitHub

fix used before assign (#33519)

上级 67a4de68
...@@ -99,13 +99,14 @@ class TestFusionGRUBF16MKLDNNOp(OpTest): ...@@ -99,13 +99,14 @@ class TestFusionGRUBF16MKLDNNOp(OpTest):
if self.with_bias: if self.with_bias:
self.inputs['Bias'] = bias self.inputs['Bias'] = bias
h0_bf16 = convert_float_to_uint16(h0_fp32)
if self.with_h0: if self.with_h0:
if self.weights_dtype == 'bf16': if self.weights_dtype == 'bf16':
self.inputs['H0'] = h0_bf16 self.inputs['H0'] = h0_bf16
elif self.weights_dtype == 'fp32': elif self.weights_dtype == 'fp32':
self.inputs['H0'] = h0_fp32 self.inputs['H0'] = h0_fp32
h0_bf16 = convert_float_to_uint16(h0_fp32)
self.outputs = {'Hidden': (hidden, self.lod)} self.outputs = {'Hidden': (hidden, self.lod)}
self.attrs = { self.attrs = {
......
...@@ -39,6 +39,7 @@ class FSTest1(FSTestBase): ...@@ -39,6 +39,7 @@ class FSTest1(FSTestBase):
fs.mkdirs(dst) fs.mkdirs(dst)
fs.mkdirs(dst + "/" + src) fs.mkdirs(dst + "/" + src)
output = "" output = ""
cmd = "{} -mv {} {}".format(fs._base_cmd, src, dst)
try: try:
fs.mv(src, dst, test_exists=False) fs.mv(src, dst, test_exists=False)
self.assertFalse(1, "can't execute cmd:{} output:{}".format(cmd, self.assertFalse(1, "can't execute cmd:{} output:{}".format(cmd,
...@@ -46,7 +47,6 @@ class FSTest1(FSTestBase): ...@@ -46,7 +47,6 @@ class FSTest1(FSTestBase):
except FSTimeOut as e: except FSTimeOut as e:
print("execute mv {} to {} timeout".format(src, dst)) print("execute mv {} to {} timeout".format(src, dst))
cmd = "{} -mv {} {}".format(fs._base_cmd, src, dst)
ret, output = fluid.core.shell_execute_cmd(cmd, 6 * 1000, 2 * 1000) ret, output = fluid.core.shell_execute_cmd(cmd, 6 * 1000, 2 * 1000)
self.assertNotEqual(ret, 0) self.assertNotEqual(ret, 0)
print("second mv ret:{} output:{}".format(ret, output)) print("second mv ret:{} output:{}".format(ret, output))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册