mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
fix instance norm double free (#1748)
This commit is contained in:
parent
31b099a37b
commit
0f5b149557
@ -152,9 +152,18 @@ void TRTInstanceNormalization::attachToContext(cudnnContext* cudnnContext,
|
|||||||
|
|
||||||
// Detach the plugin object from its execution context.
|
// Detach the plugin object from its execution context.
|
||||||
void TRTInstanceNormalization::detachFromContext() TRT_NOEXCEPT {
|
void TRTInstanceNormalization::detachFromContext() TRT_NOEXCEPT {
|
||||||
|
if (_y_desc) {
|
||||||
cudnnDestroyTensorDescriptor(_y_desc);
|
cudnnDestroyTensorDescriptor(_y_desc);
|
||||||
|
_y_desc = nullptr;
|
||||||
|
}
|
||||||
|
if (_x_desc) {
|
||||||
cudnnDestroyTensorDescriptor(_x_desc);
|
cudnnDestroyTensorDescriptor(_x_desc);
|
||||||
|
_x_desc = nullptr;
|
||||||
|
}
|
||||||
|
if (_b_desc) {
|
||||||
cudnnDestroyTensorDescriptor(_b_desc);
|
cudnnDestroyTensorDescriptor(_b_desc);
|
||||||
|
_b_desc = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TRTInstanceNormalization::configurePlugin(const nvinfer1::DynamicPluginTensorDesc* in,
|
void TRTInstanceNormalization::configurePlugin(const nvinfer1::DynamicPluginTensorDesc* in,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user