TensorRT官方插件解析

这里总结分析下TensorRT的一些官方插件,以及写插件的一些参考。

This sample implements a Hardmax layer using cuBLAS, wraps the implementation in a TensorRT plugin (with a corresponding plugin creator) and then generates a shared library module containing its code. The user then dynamically loads this library in Python, which causes the plugin to be registered in TensorRT’s PluginRegistry and makes it available to the ONNX parser.

该示例使用cuBLAS实现了一个Hardmax层,将其封装在TensorRT插件中(并提供相应的插件创建器),然后生成包含其代码的共享库模块。用户随后在Python中动态加载此库,这会导致该插件被注册到TensorRT的PluginRegistry中,并使其可用于ONNX解析器。