| 133 | * bias leads to a successful execution. |
| 134 | */ |
| 135 | TEST_CASE(NoBias, framework::DatasetMode::PRECOMMIT) |
| 136 | { |
| 137 | const auto src_shape = TensorShape(27U, 13U, 2U); |
| 138 | const auto weights_shape = TensorShape(3U, 3U, 2U, 4U); |
| 139 | const auto bias_shape = TensorShape(4U); |
| 140 | const auto dst_shape = TensorShape(25U, 11U, 4U); |
| 141 | constexpr auto dt = DataType::F32; |
| 142 | |
| 143 | auto src = create_tensor<Tensor>(src_shape, dt); |
| 144 | auto weights = create_tensor<Tensor>(weights_shape, dt); |
| 145 | auto dst = create_tensor<Tensor>(dst_shape, dt); |
| 146 | |
| 147 | const auto conv_info = PadStrideInfo(1, 1, 0, 0); |
| 148 | |
| 149 | // Create Direct Convolution function |
| 150 | NEDirectConvolutionLayer conv{}; |
| 151 | conv.configure(&src, &weights, nullptr, &dst, conv_info); |
| 152 | |
| 153 | src.allocator()->allocate(); |
| 154 | weights.allocator()->allocate(); |
| 155 | dst.allocator()->allocate(); |
| 156 | |
| 157 | library->fill_tensor_value(Accessor(src), 1.f); |
| 158 | library->fill_tensor_value(Accessor(weights), 1.f); |
| 159 | |
| 160 | conv.run(); |
| 161 | |
| 162 | // Compute reference to compare |
| 163 | SimpleTensor<float> ref_src{src_shape, dt}; |
| 164 | SimpleTensor<float> ref_weights{weights_shape, dt}; |
| 165 | SimpleTensor<float> ref_bias{bias_shape, dt}; |
| 166 | library->fill_tensor_value(ref_src, 1.f); |
| 167 | library->fill_tensor_value(ref_weights, 1.f); |
| 168 | // No bias |
| 169 | library->fill_tensor_value(ref_bias, 0.f); |
| 170 | auto ref_dst = reference::convolution_layer<float>(ref_src, ref_weights, ref_bias, dst_shape, conv_info); |
| 171 | |
| 172 | validate(Accessor(dst), ref_dst); |
| 173 | } |
| 174 | |
| 175 | // *INDENT-OFF* |
| 176 | // clang-format off |
nothing calls this directly
no test coverage detected