提交 009dbe8e 编写于 作者: L Liangliang He

Fix batch noram unit test

上级 3ff4f62b
...@@ -115,7 +115,7 @@ TEST_F(BatchNormOpTest, SimpleRandomOPENCL) { ...@@ -115,7 +115,7 @@ TEST_F(BatchNormOpTest, SimpleRandomOPENCL) {
net.AddRandomInput<DeviceType::OPENCL, float>("Scale", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Scale", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Offset", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Offset", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Mean", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Mean", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Var", {channels}, true); net.AddRandomInput<DeviceType::OPENCL, float>("Var", {channels});
// run cpu // run cpu
net.RunOp(); net.RunOp();
...@@ -176,7 +176,7 @@ TEST_F(BatchNormOpTest, SimpleRandomHalfOPENCL) { ...@@ -176,7 +176,7 @@ TEST_F(BatchNormOpTest, SimpleRandomHalfOPENCL) {
.Input("Offset") .Input("Offset")
.Input("Mean") .Input("Mean")
.Input("Var") .Input("Var")
.AddFloatArg("epsilon", 1e-3) .AddFloatArg("epsilon", 1e-1)
.Output("Output") .Output("Output")
.Finalize(net.NewOperatorDef()); .Finalize(net.NewOperatorDef());
...@@ -186,7 +186,7 @@ TEST_F(BatchNormOpTest, SimpleRandomHalfOPENCL) { ...@@ -186,7 +186,7 @@ TEST_F(BatchNormOpTest, SimpleRandomHalfOPENCL) {
net.AddRandomInput<DeviceType::OPENCL, float>("Scale", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Scale", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Offset", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Offset", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Mean", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Mean", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Var", {channels}, true); net.AddRandomInput<DeviceType::OPENCL, float>("Var", {channels});
// run cpu // run cpu
net.RunOp(); net.RunOp();
...@@ -213,7 +213,7 @@ TEST_F(BatchNormOpTest, SimpleRandomHalfOPENCL) { ...@@ -213,7 +213,7 @@ TEST_F(BatchNormOpTest, SimpleRandomHalfOPENCL) {
.Input("OffsetImage") .Input("OffsetImage")
.Input("MeanImage") .Input("MeanImage")
.Input("VarImage") .Input("VarImage")
.AddFloatArg("epsilon", 1e-3) .AddFloatArg("epsilon", 1e-1)
.Output("OutputImage") .Output("OutputImage")
.AddIntArg("T", static_cast<int>(DataType::DT_HALF)) .AddIntArg("T", static_cast<int>(DataType::DT_HALF))
.Finalize(net.NewOperatorDef()); .Finalize(net.NewOperatorDef());
...@@ -258,7 +258,7 @@ TEST_F(BatchNormOpTest, ComplexRandomOPENCL) { ...@@ -258,7 +258,7 @@ TEST_F(BatchNormOpTest, ComplexRandomOPENCL) {
net.AddRandomInput<DeviceType::OPENCL, float>("Scale", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Scale", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Offset", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Offset", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Mean", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Mean", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Var", {channels}, true); net.AddRandomInput<DeviceType::OPENCL, float>("Var", {channels});
// run cpu // run cpu
net.RunOp(); net.RunOp();
...@@ -319,7 +319,7 @@ TEST_F(BatchNormOpTest, ComplexRandomHalfOPENCL) { ...@@ -319,7 +319,7 @@ TEST_F(BatchNormOpTest, ComplexRandomHalfOPENCL) {
.Input("Offset") .Input("Offset")
.Input("Mean") .Input("Mean")
.Input("Var") .Input("Var")
.AddFloatArg("epsilon", 1e-3) .AddFloatArg("epsilon", 1e-1)
.Output("Output") .Output("Output")
.Finalize(net.NewOperatorDef()); .Finalize(net.NewOperatorDef());
...@@ -329,7 +329,7 @@ TEST_F(BatchNormOpTest, ComplexRandomHalfOPENCL) { ...@@ -329,7 +329,7 @@ TEST_F(BatchNormOpTest, ComplexRandomHalfOPENCL) {
net.AddRandomInput<DeviceType::OPENCL, float>("Scale", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Scale", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Offset", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Offset", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Mean", {channels}); net.AddRandomInput<DeviceType::OPENCL, float>("Mean", {channels});
net.AddRandomInput<DeviceType::OPENCL, float>("Var", {channels}, true); net.AddRandomInput<DeviceType::OPENCL, float>("Var", {channels});
// run cpu // run cpu
net.RunOp(); net.RunOp();
...@@ -356,7 +356,7 @@ TEST_F(BatchNormOpTest, ComplexRandomHalfOPENCL) { ...@@ -356,7 +356,7 @@ TEST_F(BatchNormOpTest, ComplexRandomHalfOPENCL) {
.Input("OffsetImage") .Input("OffsetImage")
.Input("MeanImage") .Input("MeanImage")
.Input("VarImage") .Input("VarImage")
.AddFloatArg("epsilon", 1e-3) .AddFloatArg("epsilon", 1e-1)
.Output("OutputImage") .Output("OutputImage")
.AddIntArg("T", static_cast<int>(DataType::DT_HALF)) .AddIntArg("T", static_cast<int>(DataType::DT_HALF))
.Finalize(net.NewOperatorDef()); .Finalize(net.NewOperatorDef());
...@@ -403,7 +403,7 @@ TEST_F(BatchNormOpTest, NEONTest) { ...@@ -403,7 +403,7 @@ TEST_F(BatchNormOpTest, NEONTest) {
net.AddRandomInput<DeviceType::CPU, float>("Scale", {channels}); net.AddRandomInput<DeviceType::CPU, float>("Scale", {channels});
net.AddRandomInput<DeviceType::CPU, float>("Offset", {channels}); net.AddRandomInput<DeviceType::CPU, float>("Offset", {channels});
net.AddRandomInput<DeviceType::CPU, float>("Mean", {channels}); net.AddRandomInput<DeviceType::CPU, float>("Mean", {channels});
net.AddRandomInput<DeviceType::CPU, float>("Var", {channels}, true); net.AddRandomInput<DeviceType::CPU, float>("Var", {channels});
// run cpu // run cpu
net.RunOp(); net.RunOp();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册