@@ -123,7 +123,7 @@ def copy(self):
123123 def clone (self ):
124124 return self .from_storage (self .storage .clone ())
125125
126- def type_as (self , tensor = torch .Tensor ):
126+ def type_as (self , tensor : torch .Tensor ):
127127 value = self .storage .value ()
128128 if value is None or tensor .dtype == value .dtype :
129129 return self
@@ -397,8 +397,8 @@ def to_dense(self, dtype: Optional[int] = None) -> torch.Tensor:
397397
398398 return mat
399399
400- def to_torch_sparse_coo_tensor (self , dtype : Optional [ int ] = None
401- ) -> torch .Tensor :
400+ def to_torch_sparse_coo_tensor (
401+ self , dtype : Optional [ int ] = None ) -> torch .Tensor :
402402 row , col , value = self .coo ()
403403 index = torch .stack ([row , col ], dim = 0 )
404404
@@ -505,8 +505,8 @@ def __repr__(self: SparseTensor) -> str:
505505
506506# Scipy Conversions ###########################################################
507507
508- ScipySparseMatrix = Union [scipy .sparse .coo_matrix , scipy .sparse .
509- csr_matrix , scipy .sparse .csc_matrix ]
508+ ScipySparseMatrix = Union [scipy .sparse .coo_matrix , scipy .sparse .csr_matrix ,
509+ scipy .sparse .csc_matrix ]
510510
511511
512512@torch .jit .ignore
0 commit comments