Converting Neural Network To TensorRT . Part 2 Creating a Custom Layer.

  1. CUDA kernels (aka device code)
  2. TensorRT classes: IPluginV2 and IPluginCreator

Why l2_normalize is not supported by TensorRT?

CUDA kernels

Implementing IPluginV2 and IPluginCreator

  • custom parameters (in my case “op_type” and “eps”)
  • input vector dimensions C, H, W
  • weights (no weights in my case)
L2NormHelper(int op_type, float eps, int C, int H, int W);
#include "l2norm_helper.h"



Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store