If the argument 'dim' is None, that function returns a boolean that indicates if the tensor contains a dynamic dimension (True) or not (False). In that case, the first dimension is excluded (as it usually corresponds to the batch size). If the argument is an integer
(self, dim=None)
| 526 | return repeat(self, sizes) |
| 527 | |
| 528 | def is_dynamic(self, dim=None): |
| 529 | ''' |
| 530 | If the argument 'dim' is None, that function returns a boolean that |
| 531 | indicates if the tensor contains a dynamic dimension (True) or not |
| 532 | (False). In that case, the first dimension is excluded (as it usually |
| 533 | corresponds to the batch size). If the argument is an integer, that |
| 534 | functions returns a boolean that indicates if the dimension 'dim' is |
| 535 | dynamic (True) or not (False). |
| 536 | ''' |
| 537 | if dim is not None: |
| 538 | return self.trt_tensor.shape[dim] == -1 |
| 539 | |
| 540 | for i, s in enumerate(self.trt_tensor.shape): |
| 541 | if i != 0 and s == -1: |
| 542 | return True |
| 543 | |
| 544 | return False |
| 545 | |
| 546 | # graph writer related functions |
| 547 |
no outgoing calls
no test coverage detected