def listToTensorString(array):
    """turn python list into java tensor string representation"""
    assert isinstance(array, list)
    a = [listToTensorString(element) if isinstance(element, list) else element for element in array]
    return '{%s}' % ', '.join(list(map(str, a)))