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])
| 403 | |
| 404 | |
| 405 | def get_ptr(A: Optional[Tensor]) -> Optional[ct.c_void_p]: |
| 406 | """Gets the memory address of the first element of a tenso |
| 407 | |
| 408 | Args: |
| 409 | A (`Optional[Tensor]`): A PyTorch tensor. |
| 410 | |
| 411 | Returns: |
| 412 | `Optional[ct.c_void_p]`: A pointer to the underlying tensor data. |
| 413 | """ |
| 414 | if A is None: |
| 415 | return None |
| 416 | |
| 417 | return ct.c_void_p(A.data_ptr()) |
| 418 | |
| 419 | |
| 420 | class QuantState: |
no outgoing calls
no test coverage detected