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 of torch.Tensor that have sparse storage; see SparseTensor implementation details.

Warning

This function coalesces sparse COO tensors.

Parameters:

x (Tensor) – Tensor to alias.

Returns:

(Tensor) – Alias to x.