| 95 | * bias leads to a successful execution. |
| 96 | */ |
| 97 | TEST_CASE(NoBias, framework::DatasetMode::PRECOMMIT) |
| 98 | { |
| 99 | const auto src_shape = TensorShape(27U, 13U, 2U); |
| 100 | const auto weights_shape = TensorShape(3U, 3U, 2U, 4U); |
| 101 | const auto bias_shape = TensorShape(4U); |
| 102 | const auto dst_shape = TensorShape(25U, 11U, 4U); |
| 103 | constexpr auto dt = DataType::F32; |
| 104 | |
| 105 | auto src = create_tensor<CLTensor>(src_shape, dt); |
| 106 | auto weights = create_tensor<CLTensor>(weights_shape, dt); |
| 107 | auto dst = create_tensor<CLTensor>(dst_shape, dt); |
| 108 | |
| 109 | const auto conv_info = PadStrideInfo(1, 1, 0, 0); |
| 110 | |
| 111 | // Create Direct Convolution function |
| 112 | CLDirectConvolutionLayer conv{}; |
| 113 | conv.configure(&src, &weights, nullptr, &dst, conv_info); |
| 114 | |
| 115 | src.allocator()->allocate(); |
| 116 | weights.allocator()->allocate(); |
| 117 | dst.allocator()->allocate(); |
| 118 | |
| 119 | library->fill_tensor_value(CLAccessor(src), 1.f); |
| 120 | library->fill_tensor_value(CLAccessor(weights), 1.f); |
| 121 | |
| 122 | conv.run(); |
| 123 | |
| 124 | // Compute reference to compare |
| 125 | SimpleTensor<float> ref_src{src_shape, dt}; |
| 126 | SimpleTensor<float> ref_weights{weights_shape, dt}; |
| 127 | SimpleTensor<float> ref_bias{bias_shape, dt}; |
| 128 | library->fill_tensor_value(ref_src, 1.f); |
| 129 | library->fill_tensor_value(ref_weights, 1.f); |
| 130 | // No bias |
| 131 | library->fill_tensor_value(ref_bias, 0.f); |
| 132 | auto ref_dst = reference::convolution_layer<float>(ref_src, ref_weights, ref_bias, dst_shape, conv_info); |
| 133 | |
| 134 | validate(CLAccessor(dst), ref_dst); |
| 135 | } |
| 136 | |
| 137 | /** Check whether the case of rectangle kernels i.e. when width and height of the weight_shape are not equal |
| 138 | * would lead to successful run |
nothing calls this directly
no test coverage detected