def ndim(x):
    '''Returns the number of axes in a tensor, as an integer.
    '''
    dims = x.get_shape()._dims
    if dims is not None:
        return len(dims)
    return None
dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py/ndim/original