how to use gatherlayer?

I want to gather fist element on axis = 1,
so I add a gather layer,
network.add_gather(input_tensor, trt.tensorrt.ITensor([0]), 1)
the error as follow,

TypeError: add_gather(): incompatible function arguments. The following argument types are supported:
1. (self: tensorrt.tensorrt.INetworkDefinition, input: tensorrt.tensorrt.ITensor, indices: tensorrt.tensorrt.ITensor, axis: int) -> tensorrt.tensorrt.IGatherLayer

Invoked with: <tensorrt.tensorrt.INetworkDefinition object at 0x7fc27d998880>, <tensorrt.tensorrt.ITensor object at 0x7fc27d99b260>, [0], 1

I have search the internet and develop guide for a long time,but still don’t know how to use the gather layer.Could you give me some examples?Thanks.

the version is 6.0.1

Hi,

Please refer to below python API doc:
https://docs.nvidia.com/deeplearning/sdk/tensorrt-archived/tensorrt-601/tensorrt-api/python_api/infer/Graph/Network.html#tensorrt.INetworkDefinition.add_gather

Also, you can refer to some sample C++ implementation (network->addGather):
https://github.com/NVIDIA/TensorRT/blob/07ed9b57b1ff7c24664388e5564b17f7ce2873e5/samples/opensource/sampleNMT/model/softmaxLikelihood.cpp
https://github.com/NVIDIA/TensorRT/blob/07ed9b57b1ff7c24664388e5564b17f7ce2873e5/samples/opensource/sampleNMT/model/slpEmbedder.cpp

Thanks

@SunilJB
I have read this doc,but still do no know how to contruct a indices tensor.
Could show some real code?