Commit 0832708
authored
Remove model_ref in token_graph_builder_model
With the port to TF2 I added a hack to get access to instruction
annotations and the node mask within the call function of
TokenGraphBuilderModelNodeEmbed. This was necessary due to TF2
preferring eager mode so we could not just pass tensor references
around.
This patch makes everything more canonically TF2 by moving the data
around through standard dataflow (with some slight complexity to ensure
things are getting passed around to the right places) rather than
passing references around. Either one should theoretically work with
tf.function annotations depending upon scope, but this will definitely
work.
Reviewers: orodley, virajbshah, ondrasej
Reviewed By: ondrasej
Pull Request: #3421 parent cdf8b1f commit 0832708
File tree
2 files changed
+20
-10
lines changed- gematria/granite/python
2 files changed
+20
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
376 | 379 | | |
377 | 380 | | |
378 | 381 | | |
379 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
380 | 391 | | |
381 | 392 | | |
382 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
349 | 348 | | |
350 | 349 | | |
351 | 350 | | |
| |||
364 | 363 | | |
365 | 364 | | |
366 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
367 | 370 | | |
368 | 371 | | |
369 | 372 | | |
| |||
410 | 413 | | |
411 | 414 | | |
412 | 415 | | |
413 | | - | |
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
| |||
420 | 422 | | |
421 | 423 | | |
422 | 424 | | |
423 | | - | |
424 | | - | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
428 | 427 | | |
429 | 428 | | |
430 | 429 | | |
| |||
446 | 445 | | |
447 | 446 | | |
448 | 447 | | |
| 448 | + | |
| 449 | + | |
449 | 450 | | |
450 | 451 | | |
451 | 452 | | |
| |||
458 | 459 | | |
459 | 460 | | |
460 | 461 | | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
| 462 | + | |
| 463 | + | |
465 | 464 | | |
466 | 465 | | |
467 | 466 | | |
| |||
0 commit comments