(
device, batch_size, input_shape, anchor, shape, axis_names, axes, input_layout, fill_value
)
| 189 | |
| 190 | |
| 191 | def check_operator_erase_vs_python( |
| 192 | device, batch_size, input_shape, anchor, shape, axis_names, axes, input_layout, fill_value |
| 193 | ): |
| 194 | eii1 = RandomDataIterator(batch_size, shape=input_shape, dtype=np.float32) |
| 195 | eii2 = RandomDataIterator(batch_size, shape=input_shape, dtype=np.float32) |
| 196 | |
| 197 | fill_value_arg1 = fill_value |
| 198 | fill_value_arg2 = fill_value |
| 199 | if fill_value == "random": |
| 200 | fill_eii1 = RandomDataIterator(batch_size, shape=input_shape[-1:], dtype=np.float32) |
| 201 | fill_eii2 = RandomDataIterator(batch_size, shape=input_shape[-1:], dtype=np.float32) |
| 202 | fill_value_arg1 = iter(fill_eii1) |
| 203 | fill_value_arg2 = iter(fill_eii2) |
| 204 | |
| 205 | compare_pipelines( |
| 206 | ErasePipeline( |
| 207 | device, |
| 208 | batch_size, |
| 209 | input_layout, |
| 210 | iter(eii1), |
| 211 | anchor=anchor, |
| 212 | shape=shape, |
| 213 | axis_names=axis_names, |
| 214 | axes=axes, |
| 215 | fill_value=fill_value_arg1, |
| 216 | ), |
| 217 | ErasePythonPipeline( |
| 218 | device, |
| 219 | batch_size, |
| 220 | input_layout, |
| 221 | iter(eii2), |
| 222 | anchor=anchor, |
| 223 | shape=shape, |
| 224 | axis_names=axis_names, |
| 225 | axes=axes, |
| 226 | fill_value=fill_value_arg2, |
| 227 | ), |
| 228 | batch_size=batch_size, |
| 229 | N_iterations=3, |
| 230 | eps=1e-04, |
| 231 | expected_layout=input_layout, |
| 232 | ) |
| 233 | |
| 234 | |
| 235 | def test_operator_erase_vs_python(): |
nothing calls this directly
no test coverage detected