Skip to content

Commit

Permalink
CI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jakpiase committed Jan 10, 2022
1 parent dc5e186 commit 3e70495
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/paddle/fluid/tests/book/test_fit_a_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import paddle
import paddle.fluid as fluid
import paddle.static.amp as amp
from paddle.fluid.tests.unittests.op_test import convert_float_to_uint16

import contextlib
import numpy
Expand All @@ -38,6 +37,15 @@ def convert_uint16_to_float(in_list):
return numpy.reshape(out, in_list.shape)


def convert_float_to_uint16(in_list):
out = []
for x in numpy.nditer(in_list):
out.append(
numpy.uint16(struct.unpack('<I', struct.pack('<f', x))[0] >> 16))
out = numpy.reshape(out, in_list.shape).view(numpy.uint16)
return out


def train(use_cuda, save_dirname, is_local, use_bf16, pure_bf16):
x = fluid.layers.data(name='x', shape=[13], dtype='float32')
y = fluid.layers.data(name='y', shape=[1], dtype='float32')
Expand Down

1 comment on commit 3e70495

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.