alias#
- iskra.sparse.alias(x: T) T[SOURCE]#
Creates an alias (view) of a tensor. Works on sparse tensors, unlike PyTorch’s.
The C++ function
alias()is not implemented for sparse tensors, but we can simply implement a version of it from Python. This is useful for creating subclasses oftorch.Tensorthat have sparse storage; seeSparseTensorimplementation details.Warning
This function coalesces sparse COO tensors.