From 2d7a652869da626c6418328e5786f1335fb63c1a Mon Sep 17 00:00:00 2001 From: wanghaox Date: Mon, 20 Nov 2017 10:29:09 +0800 Subject: [PATCH] del framework test_maxout_op --- paddle/operators/math/maxouting.cu | 2 +- .../v2/framework/tests/test_maxout_op.py | 41 ------------------- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 python/paddle/v2/framework/tests/test_maxout_op.py diff --git a/paddle/operators/math/maxouting.cu b/paddle/operators/math/maxouting.cu index 1a8fc465cc3..336a1bd8b5b 100644 --- a/paddle/operators/math/maxouting.cu +++ b/paddle/operators/math/maxouting.cu @@ -37,7 +37,7 @@ __global__ void KernelMaxOut(const int nthreads, const T* input_data, (batch_idx * size + channel_idx * feat_len) * groups + feat_idx; T ele = static_cast(-FLT_MAX); for (int g = 0; g < groups; ++g) { - T x=input_data[data_idx + g * feat_len]; + T x = input_data[data_idx + g * feat_len]; ele = ele > x ? ele : x; } output_data[i] = ele; diff --git a/python/paddle/v2/framework/tests/test_maxout_op.py b/python/paddle/v2/framework/tests/test_maxout_op.py deleted file mode 100644 index a7c47108f11..00000000000 --- a/python/paddle/v2/framework/tests/test_maxout_op.py +++ /dev/null @@ -1,41 +0,0 @@ -import unittest -import numpy as np -from op_test import OpTest - - -def maxout_forward_naive(input, groups,num_channels): - s0, s1, s2, s3 = input.shape - return np.ndarray([s0, s1 / groups, groups, s2, s3], \ - buffer = input, dtype=input.dtype).max(axis=(2)) - - -class TestMaxOutOp(OpTest): - def setUp(self): - self.op_type = "maxout" - self.init_test_case() - input = np.random.random(self.shape).astype("float32") - output = self.MaxOut_forward_naive(input, self.groups, - self.num_channels).astype("float32") - - self.inputs = {'X': input} - self.attrs = {'groups': self.groups, 'num_channels': self.num_channels} - - self.outputs = {'Out': output.astype('float32')} - - def test_check_output(self): - self.check_output() - - def test_check_grad(self): - self.check_grad(['X'], 'Out') - - def init_test_case(self): - self.MaxOut_forward_naive = maxout_forward_naive - self.shape = [100, 6, 2, 2] - self.groups=2 - self.num_channels=6 - - - - -if __name__ == '__main__': - unittest.main() -- GitLab