lf1-io / padl

Functional deep learning
Apache License 2.0
106 stars 4 forks source link

Saving fails with same named variable as argument #441

Open jasonkhadka opened 2 years ago

jasonkhadka commented 2 years ago
from padl import *

@transform
class B:
    def __init__(self, x):
        self.x = x

b = 2
b = B(b)

gives the following dump:

from padl import transform

b = 2

@transform
class B:
    def __init__(self, x):
        self.x = x

b = B(b)
_pd_main = B(b)

This is wrong as _pd_main = B(b) should be equivalent to B(2) but in the dump it is equivalent to B(B(2)).