torch2trt
torch2trt copied to clipboard
Update pybind11 usage for sub plugin classes
the following test would be failed in some cases:
python3 -m torch2trt.test --name=group
TypeError: add_plugin_v2(): incompatible function arguments. The following argument types are supported:
1. (self: tensorrt.tensorrt.INetworkDefinition, inputs: List[tensorrt.tensorrt.ITensor], plugin: tensorrt.tensorrt.IPluginV2) -> tensorrt.tensorrt.IPluginV2Layer
Invoked with: <tensorrt.tensorrt.INetworkDefinition object at 0x7f270e6e2a40>, [<tensorrt.tensorrt.ITensor object at 0x7f2726321d18>], <torch2trt.plugins.GroupNormPlugin object at 0x7f2726321f80>
see
#https://github.com/NVIDIA-AI-IOT/torch2trt/pull/656#issuecomment-970491423 #https://github.com/NVIDIA-AI-IOT/torch2trt/pull/656#issuecomment-1010937335
This PR try to fix this issue.