Mark a tensor as a network output. When a tensor is marked as an output, its content can be obtained after the execution of the TensorRT engine. The user is responsible for allocating buffers to store the output tensors when preparing the execution of the Te
(self,
name: Optional[str] = None,
dtype: Optional[Union[str, trt.DataType]] = None)
| 297 | self.trt_tensor.location = location |
| 298 | |
| 299 | def mark_output(self, |
| 300 | name: Optional[str] = None, |
| 301 | dtype: Optional[Union[str, trt.DataType]] = None): |
| 302 | ''' |
| 303 | Mark a tensor as a network output. |
| 304 | |
| 305 | When a tensor is marked as an output, its content can be obtained after |
| 306 | the execution of the TensorRT engine. The user is responsible for |
| 307 | allocating buffers to store the output tensors when preparing the |
| 308 | execution of the TensorRT engine. |
| 309 | ''' |
| 310 | if name is None: |
| 311 | name = self.name |
| 312 | |
| 313 | if isinstance(dtype, str): |
| 314 | dtype = str_dtype_to_trt(dtype) |
| 315 | |
| 316 | assert dtype is None or isinstance(dtype, trt.DataType) |
| 317 | default_net()._mark_output(self, name, dtype) |
| 318 | |
| 319 | def __add__(self, b): |
| 320 | ''' |