| 26 | using singa::PReLU; |
| 27 | using singa::Shape; |
| 28 | TEST(PReLU, Setup) { |
| 29 | PReLU prelu; |
| 30 | // EXPECT_EQ("PReLU", prelu.layer_type()); |
| 31 | |
| 32 | singa::LayerConf conf; |
| 33 | singa::PReLUConf *preluconf = conf.mutable_prelu_conf(); |
| 34 | preluconf->set_channel_shared(true); |
| 35 | preluconf->set_format("NHWC"); |
| 36 | |
| 37 | prelu.Setup(Shape{4}, conf); |
| 38 | EXPECT_EQ(true, prelu.Channel_shared()); |
| 39 | EXPECT_EQ("NHWC", prelu.Format()); |
| 40 | } |
| 41 | |
| 42 | TEST(PReLU, ForwardCPU) { |
| 43 | const float x[] = {1.f, 2.f, 3.f, -2.f, -3.f, -1.f, |