Skip to content

Commit 6aa9897

Browse files
committed
fix used before assign
1 parent 6c11034 commit 6aa9897

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

python/paddle/fluid/tests/unittests/mkldnn/test_fusion_gru_bf16_mkldnn_op.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,14 @@ def setUp(self):
9898
if self.with_bias:
9999
self.inputs['Bias'] = bias
100100

101+
h0_bf16 = convert_float_to_uint16(h0_fp32)
102+
101103
if self.with_h0:
102104
if self.weights_dtype == 'bf16':
103105
self.inputs['H0'] = h0_bf16
104106
elif self.weights_dtype == 'fp32':
105107
self.inputs['H0'] = h0_fp32
106108

107-
h0_bf16 = convert_float_to_uint16(h0_fp32)
108109
self.outputs = {'Hidden': (hidden, self.lod)}
109110

110111
self.attrs = {

python/paddle/fluid/tests/unittests/test_hdfs1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ def test_timeout(self):
3939
fs.mkdirs(dst)
4040
fs.mkdirs(dst + "/" + src)
4141
output = ""
42+
cmd = "{} -mv {} {}".format(fs._base_cmd, src, dst)
4243
try:
4344
fs.mv(src, dst, test_exists=False)
4445
self.assertFalse(1, "can't execute cmd:{} output:{}".format(cmd,
4546
output))
4647
except FSTimeOut as e:
4748
print("execute mv {} to {} timeout".format(src, dst))
4849

49-
cmd = "{} -mv {} {}".format(fs._base_cmd, src, dst)
5050
ret, output = fluid.core.shell_execute_cmd(cmd, 6 * 1000, 2 * 1000)
5151
self.assertNotEqual(ret, 0)
5252
print("second mv ret:{} output:{}".format(ret, output))

0 commit comments

Comments
 (0)