Returns the shape of the tensor if the dim parameter is None. Otherwise, returns a size of the dimension indicated by dim. The behavior is undefined if dim is negative or exceeds the rank of the tensor.
(self, dim=None)
| 478 | return cast(self, dtype) |
| 479 | |
| 480 | def size(self, dim=None): |
| 481 | ''' |
| 482 | Returns the shape of the tensor if the dim parameter is None. |
| 483 | Otherwise, returns a size of the dimension indicated by dim. The |
| 484 | behavior is undefined if dim is negative or exceeds the rank of the |
| 485 | tensor. |
| 486 | ''' |
| 487 | if dim is None: |
| 488 | return self.trt_tensor.shape |
| 489 | |
| 490 | return self.trt_tensor.shape[dim] |
| 491 | |
| 492 | def rank(self): |
| 493 | ''' |
no outgoing calls