Replace the input `src` with the input `dst` in the raw_inputs. src: Tensor dst: Tensor
(self, src, dst)
| 371 | return copy(self.raw_inputs) |
| 372 | |
| 373 | def replace_input_with(self, src, dst): |
| 374 | """Replace the input `src` with the input `dst` in the raw_inputs. |
| 375 | |
| 376 | src: Tensor |
| 377 | dst: Tensor |
| 378 | """ |
| 379 | from .functional import Tensor |
| 380 | |
| 381 | def replace(arg: Any): |
| 382 | if isinstance(arg, Tensor): |
| 383 | if arg.trt_tensor is src.trt_tensor: |
| 384 | return dst |
| 385 | return arg |
| 386 | elif isinstance(arg, (list, tuple)): |
| 387 | return [replace(x) for x in arg] |
| 388 | elif isinstance(arg, dict): |
| 389 | return {k: replace(v) for k, v in arg.items()} |
| 390 | return arg |
| 391 | |
| 392 | replace(self.raw_inputs) |
| 393 | |
| 394 | def replace_outputs_uses_with(self, net: Network, new_outs: List[Any]): |
| 395 | """Replace the output users with the new outputs. |
no outgoing calls
no test coverage detected