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

test(cinn): remove one hot op mapper test #57987

Merged
merged 1 commit into from
Oct 11, 2023
Merged
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
48 changes: 0 additions & 48 deletions test/cinn/op_mappers/test_one_hot_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,54 +19,6 @@
import paddle


class TestOneHotOp(OpMapperTest):
def init_input_data(self):
self.feed_data = {'x': self.random([1, 32], 'int32', low=0, high=9)}
self.depth = 10
self.dtype = "float32"
self.allow_out_of_range = False

def set_op_type(self):
return "one_hot"

def set_op_inputs(self):
x = paddle.static.data(
name='x',
shape=self.feed_data['x'].shape,
dtype=self.feed_data['x'].dtype,
)
return {'X': [x]}

def set_op_attrs(self):
return {
"depth": self.depth,
"dtype": self.nptype2paddledtype(self.dtype),
"allow_out_of_range": self.allow_out_of_range,
}

def set_op_outputs(self):
return {'Out': [str(self.feed_data['x'].dtype)]}

def test_check_results(self):
self.check_outputs_and_grads(all_equal=True)


class TestOneHotOpCase1(TestOneHotOp):
def init_input_data(self):
self.feed_data = {'x': self.random([32, 64], 'int32')}
self.depth = 64
self.dtype = "int32"
self.allow_out_of_range = False


class TestOneHotOpCase2(TestOneHotOp):
def init_input_data(self):
self.feed_data = {'x': self.random([32, 64, 1], 'int64')}
self.depth = 1
self.dtype = "int64"
self.allow_out_of_range = True


class TestOneHotV2Op(OpMapperTest):
def init_input_data(self):
self.feed_data = {'x': self.random([1, 32], 'int32')}
Expand Down