Skip to content

Changed the backward method implementation from recursive to stack#90

Open
Mikelenjilo wants to merge 1 commit intokarpathy:masterfrom
Mikelenjilo:fix/backward_function
Open

Changed the backward method implementation from recursive to stack#90
Mikelenjilo wants to merge 1 commit intokarpathy:masterfrom
Mikelenjilo:fix/backward_function

Conversation

@Mikelenjilo
Copy link

I run into a proble of RecursionError when the depth of the graph is longer than 1000. That may happen when there is a very long mathematical expression based on atomic operations (+, -, etc.). So the new implementation is based on the DPS algorithm using a stack. This removes the recursion limit (default to 1000) and can create a topological graph for an infinite depth.

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.

1 participant