Remove NVDSINFER_TENSOR_OUTPUT_META after updating metadata(while using multiple cascaded models)

Please provide complete information as applicable to your setup.

• Hardware Platform: RTX 2080
• DeepStream Version: 5.0
• TensorRT Version
• NVIDIA GPU Driver Version: 440.33.01

Hi,
I have a pipeline with multiple nvinfer and nvinferserver plugins back to back. Some the models are custom so I use output_tensor_meta: true to attach the output tensor and update the metadata related to objects in the pipeline itself. I want to remove the attached NVDSINFER_TENSOR_OUTPUT_META after updating the metadata otherwise while probing the downstream element’s output the tensor_output_meta of previous upstream element is still present.

For example if I have pgie -> sgie and have set output_tensor_meta: true for both the models then while probing sgie element, I output tensor of pgie is still present. Is there a way to remove pgie tensor while probing pgie output so that it is not reflected in downstream elements.

Thanks.