tptv1.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:TerpreT 作者: 51alg 项目源码 文件源码
def get_var_name(node):
    if isinstance(node, ast.Name):
        return node.id
    elif isinstance(node, ast.Subscript):
        return get_var_name(node.value)
    elif isinstance(node, ast.Call):
        return None  # This is the Input()[10] case
    else:
        raise Exception("Can't extract var name from '%s'" % (unparse(node).rstrip()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号