for input[1, 1024, 2560], i wanna slice input[:,:512,:]
network.add_slice(input, (0, 0, 0), (1, 512, 2560), (1,1,1))
the code is ok?
could someone offer some good examples?
for input[1, 1024, 2560], i wanna slice input[:,:512,:]
network.add_slice(input, (0, 0, 0), (1, 512, 2560), (1,1,1))
the code is ok?
could someone offer some good examples?
Hi,
You can find some information here:
https://docs.nvidia.com/deeplearning/sdk/tensorrt-api/python_api/infer/Graph/Layers.html#islicelayer
ITensor* input = network->addInput("input", DataType::kFLOAT, {2, {6, 1}});
const Dims begin = {2, {1, 0}};
const Dims size = {2, {3, 1}};
const Dims strides = {2, {1, 1}};
ISliceLayer* slice = network->addSlice(*input, begin, size, strides);
network->markOutput(*slice->getOutput(0));
Thanks.