()
| 69 | return output |
| 70 | |
| 71 | def main(): |
| 72 | load_plugin_lib() |
| 73 | for num_dims in range(1, 8): |
| 74 | for axis in range(-num_dims, num_dims): |
| 75 | shape = np.random.randint(1, 4, size=num_dims) |
| 76 | arr = np.random.rand(*shape) |
| 77 | arr = (arr - 0.5) * 200 |
| 78 | engine = make_trt_network_and_engine(shape, axis) |
| 79 | res1 = hardmax_reference_impl(arr, axis) |
| 80 | res2 = custom_plugin_impl(arr, engine).reshape(res1.shape) |
| 81 | assert np.all(res1 == res2), f"Test failed for shape={shape}, axis={axis}" |
| 82 | print("Passed") |
| 83 | |
| 84 | if __name__ == '__main__': |
| 85 | main() |
no test coverage detected