Skip to content

fix issue 533 for ubuntu#542

Open
difurka wants to merge 1 commit intoKindXiaoming:masterfrom
difurka:fix_issue_533
Open

fix issue 533 for ubuntu#542
difurka wants to merge 1 commit intoKindXiaoming:masterfrom
difurka:fix_issue_533

Conversation

@difurka
Copy link
Copy Markdown

@difurka difurka commented Apr 29, 2025

add globals() - this works for ubuntu

Comment thread kan/MultKAN.py
Comment on lines 2276 to 2277
for ii in range(1, self.width[0][0] + 1):
exec(f"x{ii} = sympy.Symbol('x_{ii}')")
exec(f"x{ii} = sympy.Symbol('x_{ii}')", globals())
exec(f"x.append(x{ii})")
Copy link
Copy Markdown

@joshua-cogliati-inl joshua-cogliati-inl May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why is this code not just:

                x.append(sympy.Symbol(f"x_{ii}"))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it works for Ubuntu too

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, then either this pull request or #545 can solve the problem.

@joshua-cogliati-inl
Copy link
Copy Markdown

Note that this would close #533 and #543

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants