square#

iskra.sparse.square(x: SparseTensor) SparseTensor[SOURCE]#

Elementwise square of sparse tensors.

Patches a lack of support for this function in PyTorch for CSR tensors.

Parameters:

x (SparseTensor) – Sparse tensor to square.

Returns:

(SparseTensor) – Sparse tensor with each entry squared.