def as_sparse_or_tensor_variable(x, name=None):

    try:
        return as_sparse_variable(x, name)
    except (ValueError, TypeError):
        return theano.tensor.as_tensor_variable(x, name)
This function trains a HMM model for segmentation-classification using a where WAV files and .segment (ground-truth files) are stored
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/sparse/basic.py/as_sparse_or_tensor_variable--crossover with--dataset/ETHPy150Open tyiannak/pyAudioAnalysis/audioSegmentation.py/trainHMM_fromDir