PaddlePaddle / PaddleSOT

A Bytecode level Implementation of Symbolic OpCode Translator For PaddlePaddle
Apache License 2.0
15 stars 25 forks source link

add type guard to ContainerVariable #390

Closed SigureMo closed 1 year ago

SigureMo commented 1 year ago

此前 ContainerVariable 没有类型 guard,导致如下两个 case 会误命中 cache

x_1 = [Tensor(1), Tensor(2)]
x_2 = Tensor([1, 2])

# 根据 x_1 生成的 guard:
# len(x) == 2 and x[0].shape == [] ...

这种情况是无法区分两者的,因此需要增加类型 guard 确保不会错误命中

paddle-bot[bot] commented 1 year ago

Thanks for your contribution!