Skip to content

Commit

Permalink
Rename the class name in unittest.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xreki committed Sep 28, 2021
1 parent e94a526 commit daa3057
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions paddle/fluid/operators/fused/cudnn_norm_conv_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ void ComputeSumAndSquareSum(const framework::Tensor &cpu_out,
}

template <typename T>
class TestCudnnNormConvOpForward {
class CudnnNormConvolutionTester {
public:
TestCudnnNormConvOpForward(int batch_size, int height, int width,
CudnnNormConvolutionTester(int batch_size, int height, int width,
int input_channels, int output_channels,
int kernel_size, int stride) {
batch_size_ = batch_size;
Expand All @@ -219,7 +219,7 @@ class TestCudnnNormConvOpForward {
SetUp();
}

~TestCudnnNormConvOpForward() {}
~CudnnNormConvolutionTester() {}

void CheckForward(float diff, bool is_relative_atol = false) {
platform::CUDADeviceContext *ctx =
Expand Down Expand Up @@ -391,47 +391,47 @@ class TestCudnnNormConvOpForward {
};

// test for fp16, kernel = 1, output_channels = input_channels
TEST(CudnnNormConvForward, GPUCudnnNormConvForward1Fp16) {
TEST(CudnnNormConvFp16, K1S1) {
int batch_size = 4;
int height = 56;
int width = 56;
int input_channels = 32;
int output_channels = 32;
int kernel_size = 1;
int stride = 1;
TestCudnnNormConvOpForward<paddle::platform::float16> test(
CudnnNormConvolutionTester<paddle::platform::float16> test(
batch_size, height, width, input_channels, output_channels, kernel_size,
stride);
test.CheckForward(1e-3, true);
test.CheckBackward(1e-3, true);
}

// test for fp16, kernel = 3, output_channels = input_channels
TEST(CudnnNormConvForward, GPUCudnnNormConvForward2Fp16) {
TEST(CudnnNormConvFp16, K3S1) {
int batch_size = 4;
int height = 56;
int width = 56;
int input_channels = 32;
int output_channels = 32;
int kernel_size = 3;
int stride = 1;
TestCudnnNormConvOpForward<paddle::platform::float16> test(
CudnnNormConvolutionTester<paddle::platform::float16> test(
batch_size, height, width, input_channels, output_channels, kernel_size,
stride);
test.CheckForward(1e-3, true);
test.CheckBackward(1e-3, true);
}

// test for fp16, kernel = 1, output_channels = input_channels * 4
TEST(CudnnNormConvForward, GPUCudnnNormConvForward3Fp16) {
TEST(CudnnNormConvFp16, K1S1O4) {
int batch_size = 4;
int height = 56;
int width = 56;
int input_channels = 32;
int output_channels = 128;
int kernel_size = 1;
int stride = 1;
TestCudnnNormConvOpForward<paddle::platform::float16> test(
CudnnNormConvolutionTester<paddle::platform::float16> test(
batch_size, height, width, input_channels, output_channels, kernel_size,
stride);
test.CheckForward(1e-3, true);
Expand Down

1 comment on commit daa3057

@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.