@@ -442,14 +442,15 @@ TEST(ConvolutionalLayerTest, DepthwiseIntegration) {
442442 std::vector<float > kernelvec (18 , 1 .0f );
443443 Shape kernel_shape ({2 , 1 , 3 , 3 });
444444 Tensor kernel = make_tensor (kernelvec, kernel_shape);
445+ Tensor bias;
445446
446447 size_t out_height = (4 + 2 * 1 - 1 * (3 - 1 ) - 1 ) / 1 + 1 ;
447448 size_t out_width = (4 + 2 * 1 - 1 * (3 - 1 ) - 1 ) / 1 + 1 ;
448449 Shape output_shape ({1 , 2 , out_height, out_width});
449450 std::vector<float > output_vec (32 , 0 .0f );
450451 Tensor output = make_tensor (output_vec, output_shape);
451452
452- ConvolutionalLayer layer (1 , 1 , 1 , kernel, Tensor () , 2 );
453+ ConvolutionalLayer layer (1 , 1 , 1 , kernel, bias , 2 );
453454 std::vector<Tensor> in{input};
454455 std::vector<Tensor> out{output};
455456
@@ -570,12 +571,13 @@ TEST(ConvolutionalLayerTest, DepthwiseViaConvolutionalLayer) {
570571 std::vector<float > kernelvec (18 , 1 .0f );
571572 Shape kernel_shape ({2 , 1 , 3 , 3 });
572573 Tensor kernel = make_tensor (kernelvec, kernel_shape);
574+ Tensor bias;
573575
574576 Shape output_shape ({1 , 2 , 2 , 2 });
575577 std::vector<float > output_vec (8 , 0 .0f );
576578 Tensor output = make_tensor (output_vec, output_shape);
577579
578- ConvolutionalLayer layer (1 , 0 , 1 , kernel, Tensor () , 2 );
580+ ConvolutionalLayer layer (1 , 0 , 1 , kernel, bias , 2 );
579581 std::vector<Tensor> in{input};
580582 std::vector<Tensor> out{output};
581583 layer.run (in, out);
@@ -603,7 +605,7 @@ TEST_F(ConvTestFixture, Conv4DSTLViaConvolutionalLayer) {
603605 std::vector<float > output_vec (8 , 0 .0f );
604606 Tensor output = make_tensor (output_vec, output_shape);
605607
606- ConvolutionalLayer layer (1 , 0 , 1 , kernel, Tensor () );
608+ ConvolutionalLayer layer (1 , 0 , 1 , kernel);
607609 std::vector<Tensor> in{input};
608610 std::vector<Tensor> out{output};
609611 layer.run (in, out, options);
@@ -685,14 +687,15 @@ TEST(ConvolutionalLayerTest, Conv4DLegacyViaConvolutionalLayer) {
685687 std::vector<float > kernelvec (54 , 1 .0f );
686688 Shape kernel_shape ({3 , 3 , 3 , 2 });
687689 Tensor kernel = make_tensor (kernelvec, kernel_shape);
690+ Tensor bias;
688691
689692 size_t out_height = (4 + 2 * 0 - 1 * (3 - 1 ) - 1 ) / 1 + 1 ;
690693 size_t out_width = (4 + 2 * 0 - 1 * (3 - 1 ) - 1 ) / 1 + 1 ;
691694 Shape output_shape ({1 , 2 , out_height, out_width});
692695 std::vector<float > output_vec (8 , 0 .0f );
693696 Tensor output = make_tensor (output_vec, output_shape);
694697
695- ConvolutionalLayer layer (1 , 0 , 1 , kernel, Tensor () , 1 , true );
698+ ConvolutionalLayer layer (1 , 0 , 1 , kernel, bias , 1 , true );
696699 std::vector<Tensor> in{input};
697700 std::vector<Tensor> out{output};
698701
@@ -802,14 +805,15 @@ TEST(ConvolutionalLayerTest, DepthwiseConv4DNoBiasIntPathCoverage) {
802805 std::vector<int > kernelvec = {1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 };
803806 Shape kernel_shape ({2 , 1 , 2 , 2 });
804807 Tensor kernel = make_tensor (kernelvec, kernel_shape);
808+ Tensor bias;
805809
806810 size_t out_height = (2 + 2 * 0 - 1 * (2 - 1 ) - 1 ) / 1 + 1 ;
807811 size_t out_width = (2 + 2 * 0 - 1 * (2 - 1 ) - 1 ) / 1 + 1 ;
808812 Shape output_shape ({1 , 2 , out_height, out_width});
809813 std::vector<int > output_vec (2 , 0 );
810814 Tensor output = make_tensor (output_vec, output_shape);
811815
812- ConvolutionalLayer layer (1 , 0 , 1 , kernel, Tensor () , 2 );
816+ ConvolutionalLayer layer (1 , 0 , 1 , kernel, bias , 2 );
813817 std::vector<Tensor> in{input};
814818 std::vector<Tensor> out{output};
815819
@@ -828,14 +832,15 @@ TEST(ConvolutionalLayerTest, DepthwiseConv4DNoBiasFloatPathCoverage) {
828832 0 .5f , 0 .5f , 0 .5f , 0 .5f };
829833 Shape kernel_shape ({2 , 1 , 2 , 2 });
830834 Tensor kernel = make_tensor (kernelvec, kernel_shape);
835+ Tensor bias;
831836
832837 size_t out_height = (2 + 2 * 0 - 1 * (2 - 1 ) - 1 ) / 1 + 1 ;
833838 size_t out_width = (2 + 2 * 0 - 1 * (2 - 1 ) - 1 ) / 1 + 1 ;
834839 Shape output_shape ({1 , 2 , out_height, out_width});
835840 std::vector<float > output_vec (2 , 0 .0f );
836841 Tensor output = make_tensor (output_vec, output_shape);
837842
838- ConvolutionalLayer layer (1 , 0 , 1 , kernel, Tensor () , 2 );
843+ ConvolutionalLayer layer (1 , 0 , 1 , kernel, bias , 2 );
839844 std::vector<Tensor> in{input};
840845 std::vector<Tensor> out{output};
841846
@@ -1051,12 +1056,13 @@ TEST_F(ConvTestFixture, Conv4DWithParallelNoneBackend) {
10511056 std::vector<float > kernelvec (54 , 1 .0f );
10521057 Shape kernel_shape ({2 , 3 , 3 , 3 });
10531058 Tensor kernel = make_tensor (kernelvec, kernel_shape);
1059+ Tensor bias;
10541060
10551061 Shape output_shape ({1 , 2 , 2 , 2 });
10561062 std::vector<float > output_vec (8 , 0 .0f );
10571063 Tensor output = make_tensor (output_vec, output_shape);
10581064
1059- ConvolutionalLayer layer (1 , 0 , 1 , kernel, Tensor () );
1065+ ConvolutionalLayer layer (1 , 0 , 1 , kernel, bias );
10601066 std::vector<Tensor> in{input};
10611067 std::vector<Tensor> out{output};
10621068 layer.run (in, out, defaultOptions);
@@ -1085,7 +1091,7 @@ TEST(ConvolutionalLayerTest, Conv4DWithParallelDefaultFallback) {
10851091 std::vector<float > output_vec (8 , 0 .0f );
10861092 Tensor output = make_tensor (output_vec, output_shape);
10871093
1088- ConvolutionalLayer layer (1 , 0 , 1 , kernel, Tensor () );
1094+ ConvolutionalLayer layer (1 , 0 , 1 , kernel);
10891095 std::vector<Tensor> in{input};
10901096 std::vector<Tensor> out{output};
10911097 layer.run (in, out, options);
@@ -1113,7 +1119,7 @@ TEST_F(ConvTestFixture, Conv4DWithoutParallelFlag) {
11131119 std::vector<float > output_vec (8 , 0 .0f );
11141120 Tensor output = make_tensor (output_vec, output_shape);
11151121
1116- ConvolutionalLayer layer (1 , 0 , 1 , kernel, Tensor () );
1122+ ConvolutionalLayer layer (1 , 0 , 1 , kernel);
11171123 std::vector<Tensor> in{input};
11181124 std::vector<Tensor> out{output};
11191125 layer.run (in, out, options);
0 commit comments