Gets the memory address of the first element of a tenso Args: A (`Optional[Tensor]`): A PyTorch tensor. Returns: `Optional[ct.c_void_p]`: A pointer to the underlying tensor data.
(A: Optional[Tensor])
| 432 | |
| 433 | |
| 434 | def get_ptr(A: Optional[Tensor]) -> Optional[ct.c_void_p]: |
| 435 | """Gets the memory address of the first element of a tenso |
| 436 | |
| 437 | Args: |
| 438 | A (`Optional[Tensor]`): A PyTorch tensor. |
| 439 | |
| 440 | Returns: |
| 441 | `Optional[ct.c_void_p]`: A pointer to the underlying tensor data. |
| 442 | """ |
| 443 | if A is None: |
| 444 | return None |
| 445 | |
| 446 | return ct.c_void_p(A.data_ptr()) |
| 447 | |
| 448 | |
| 449 | class QuantState: |
no outgoing calls
no test coverage detected
searching dependent graphs…