def sp_ones_like(x):
 (data, indices, indptr, shape) = csm_properties(x)
 return CSM(format=x.format)(tensor.ones_like(data), indices, indptr, shape)

def sp_ones_like ( x ) : ( data , indices , indptr , shape ) = csm_properties ( x ) return CSM ( format = x . format ) ( tensor . ones_like ( data ) , indices , indptr , shape )
construct a sparse matrix of ones with the same sparsity pattern .