

def sp_ones_like(x):
    '\n    Construct a sparse matrix of ones with the same sparsity pattern.\n\n    Parameters\n    ----------\n    x\n        Sparse matrix to take the sparsity pattern.\n\n    Returns\n    -------\n    A sparse matrix\n        The same as `x` with data changed for ones.\n\n    '
    (data, indices, indptr, shape) = csm_properties(x)
    return CSM(format=x.format)(tensor.ones_like(data), indices, indptr, shape)

dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/sparse/basic.py sp_ones_like/original