Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to solve the data dependency problem when building the computing graph? #1036

Open
eljrte opened this issue Dec 1, 2024 · 3 comments
Open

Comments

@eljrte
Copy link

eljrte commented Dec 1, 2024

When I am building a computing graph and creating two tensors eg. A & B . tensor B's shape(ne) is dependent on A's data member, which is unknown before compute_forward the graph and is illegal to reach when building graph.
How can I deal with such cases? As I want to be more dynamic in building the graph. Thanks a lot.

@JohannesGaessler
Copy link
Collaborator

I think it is not intended for tensor shapes to be set dynamically during the compute graph evaluation. A branching evaluation based on some condition would maybe be possible but this is not implemented (and may be seen as adding too much complexity). What you can do is create two separate compute graphs and change how you construct the second one based on the results of the first one.

@eljrte
Copy link
Author

eljrte commented Dec 2, 2024

I think it is not intended for tensor shapes to be set dynamically during the compute graph evaluation. A branching evaluation based on some condition would maybe be possible but this is not implemented (and may be seen as adding too much complexity). What you can do is create two separate compute graphs and change how you construct the second one based on the results of the first one.

Thanks a lot. And is it possible to build nested compute graphs? Like I have a "big" compute graph, and I build and run a smaller compute graph inside it, using its result in the big graph?

@JohannesGaessler
Copy link
Collaborator

No, and I think this is not intended either.

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

No branches or pull requests

2 participants