Commit 0ca2767
Reuse the mechanism of py_utils to have empty name for EMA variable_scope.
Currently, EMA variable scope name is the same to tf.get_variable_scope().
The implementation relies on who is caller. If the caller's variable_scope has
a name, the code assumption is broken.
py_utils.CreateVariable has same requirement, which removes variable_scope
prefix (e.g. train, evaler_cpu). So py_utils.GetLingvoVariableCreator() is used
when creating tf.variable, which works no matter graph or eager mode.
Let EMA variable scope reuse py_utils.GetLingvoVariableCreator(). EMA variable
is just variable, so it doesn't need special treatment.
In addition, remove unused _EMAVariableScope().
PiperOrigin-RevId: 4878795271 parent 2c75e99 commit 0ca2767
2 files changed
+4
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | 896 | | |
914 | 897 | | |
915 | 898 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
850 | 849 | | |
851 | 850 | | |
852 | 851 | | |
853 | | - | |
854 | | - | |
855 | | - | |
| 852 | + | |
| 853 | + | |
856 | 854 | | |
857 | 855 | | |
| 856 | + | |
| 857 | + | |
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| |||
0 commit comments