Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Hackathon No.64】增加 unbind 算子FP16单测 #52400

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions python/paddle/fluid/tests/unittests/test_unbind_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,30 @@ def outReshape(self):
self.out[1] = self.out[1].reshape((3, 2))


class TestUnbindFP16Op(OpTest):
def setUp(self):
paddle.disable_static()
self.op_type = "unbind"
self.python_api = paddle.unbind
self.dtype = self.get_dtype()
self.axis = 0
self.num = 3
x = np.arange(12).reshape(3, 2, 2).astype(self.dtype)
self.out = np.split(x, self.num, self.axis)
self.inputs = {'X': x}
self.attrs = {'axis': self.axis}
self.outputs = {
'Out': [('out%d' % i, self.out[i]) for i in range(len(self.out))]
}
self.python_out_sig = ['out%d' % i for i in range(len(self.out))]

def get_dtype(self):
return np.float16

def test_check_output(self):
self.check_output()


class TestUnbindBF16Op(OpTest):
def setUp(self):
paddle.disable_static()
Expand Down