-
Notifications
You must be signed in to change notification settings - Fork 5
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
name
variable confusion when using graph generators as tasks
#207
Comments
Thanks for opening the issue! Take your workgraph as an example. Suppose your task1 = wg.add_task(wg1)
task2 = wg.add_task(wg1) If there is no auto-appending of the task counter, both tasks will have the same name Of course, the user can provide the name explicitly, and in this case, the provided name will be used. task1 = wg.add_task(wg1, name="compute1x1-abc")
task2 = wg.add_task(wg1, name="compute1x1-xyz") |
All good. However, in my use case, the generated workgraph But if I understand you correctly, the problem is not that |
Yes, your wg = WorkGraph("sweep")
for n in [1, 2]:
wg1 = compute_graph(n, suffix=f"for_{n}")
wg.add_task(wg1)
wg.add_task(wg1) This will give an error because of the name collision. Note, the WorkGraph only knows the name of the Using the same wg1 = compute_graph(1)
for i in range(n):
task1 = wg.add_task(wg1, name="structure{i}")
# Later you can update the input for the workgraph task
task1.set({"define_structure.repetitions": [n, n, 1]) |
If one creates a
WorkGraph
with tasks that are calls to graph builders:where
compute_graph
isthe graph builder task will append a digit (starting at 1) to each
compute
task, such that the end result iswhere the first digit is part of the
suffix
, and the second is that appended by the graph builder.There are use cases for which the auto-appending of the task counter is desired/required. @superstar54 please explain.
To avoid the above issue, @superstar54 recommends to explicitly name the tasks:
The
suffix
may still be useful if thecompute_graph
graph builder returns a workgraph that needs to assign thesuffix
to its own tasks. In this case, see issue #208.The text was updated successfully, but these errors were encountered: