In this discussion about Creating A Network Definition From Scratch Using The C++ API, the network is defined using TensorRT APIs. But how to initialize weights to the network is not described.
Please refer to this sample:
https://github.com/NVIDIA/TensorRT/blob/master/samples/opensource/sampleMNISTAPI/sampleMNISTAPI.cpp
Thanks