`torch.unique` with equivalent implementation for numpy. Args: x: array/tensor.
(x: NdarrayTensor, **kwargs)
| 439 | |
| 440 | |
| 441 | def unique(x: NdarrayTensor, **kwargs) -> NdarrayTensor: |
| 442 | """`torch.unique` with equivalent implementation for numpy. |
| 443 | |
| 444 | Args: |
| 445 | x: array/tensor. |
| 446 | """ |
| 447 | return np.unique(x, **kwargs) if isinstance(x, (np.ndarray, list)) else torch.unique(x, **kwargs) # type: ignore |
| 448 | |
| 449 | |
| 450 | def linalg_inv(x: NdarrayTensor) -> NdarrayTensor: |
no outgoing calls
no test coverage detected
searching dependent graphs…