22
22
< link rel ="import " href ="../paper-input/paper-textarea.html ">
23
23
< link rel ="import " href ="../paper-item/paper-item.html ">
24
24
< link rel ="import " href ="../paper-menu/paper-menu.html ">
25
+ < link rel ="import " href ="../paper-progress/paper-progress.html ">
26
+ < link rel ="import " href ="../paper-spinner/paper-spinner-lite.html ">
25
27
< link rel ="import " href ="../paper-toast/paper-toast.html ">
26
28
< link rel ="import " href ="../polymer/polymer.html ">
27
29
< link rel ="import " href ="../tf-backend/tf-backend.html ">
@@ -99,7 +101,7 @@ <h2>Continue...</h2>
99
101
out-graph-hierarchy ="{{graphHierarchy}} "
100
102
out-graph ="{{graph}} "
101
103
out-stats ="{{stats}} "
102
- progress ="{{_progress }} "
104
+ progress ="{{_graphProgress }} "
103
105
> </ tf-graph-loader >
104
106
</ div >
105
107
</ div >
@@ -124,18 +126,15 @@ <h2>Continue...</h2>
124
126
</ template >
125
127
</ paper-menu >
126
128
</ paper-dropdown-menu >
129
+ < paper-spinner-lite class ="spinner " id ="top-right-spinner "> </ paper-spinner-lite >
130
+ < paper-progress id ="top-right-progress-bar " value ="0 "> </ paper-progress >
127
131
< template is ="dom-if " if ="[[_isTopRightRuntimeGraphsActive]] ">
128
- < div id ="graph-header ">
129
- < span id ="runtime-graph-label ">
130
- Runtime Graphs
131
- </ span >
132
- </ div >
133
132
< div id ="graph-container ">
134
133
< tf-graph id ="graph "
135
134
graph-hierarchy ="[[graphHierarchy]] "
136
135
basic-graph ="[[graph]] "
137
136
stats ="[[stats]] "
138
- progress ="[[_progress]] "
137
+ progress ="{{_graphProgress}} "
139
138
color-by ="structure "
140
139
color-by-params ="{{colorByParams}} "
141
140
render-hierarchy ="{{_renderHierarchy}} "
@@ -209,6 +208,11 @@ <h2>Continue...</h2>
209
208
width : 350px ;
210
209
display : inline-block;
211
210
}
211
+ # top-right-progress-bar {
212
+ width : 100% ;
213
+ display : inline-block;
214
+ vertical-align : middle;
215
+ }
212
216
.line-item {
213
217
display : block;
214
218
padding-top : 5px ;
@@ -230,6 +234,11 @@ <h2>Continue...</h2>
230
234
min-width : 150px ;
231
235
border : 1px solid # d4d4d4 ;
232
236
}
237
+ .spinner {
238
+ width : 20px ;
239
+ height : 20px ;
240
+ vertical-align : middle;
241
+ }
233
242
.node-entries {
234
243
height : 66% ;
235
244
overflow : auto;
@@ -390,6 +399,10 @@ <h2>Continue...</h2>
390
399
value : - 1 ,
391
400
} ,
392
401
402
+ _graphProgress : {
403
+ type : Object ,
404
+ } ,
405
+
393
406
_requestManager : {
394
407
type : Object ,
395
408
value : ( ) => new tf_backend . RequestManager ( 50 ) ,
@@ -398,6 +411,7 @@ <h2>Continue...</h2>
398
411
399
412
observers : [
400
413
"_onActiveRuntimeGraphDeviceNameChange(_activeRuntimeGraphDeviceName)" ,
414
+ "_graphProgressUpdated(_graphProgress)" ,
401
415
] ,
402
416
403
417
ready ( ) {
@@ -484,6 +498,7 @@ <h2>Continue...</h2>
484
498
485
499
this . _maybeUpdateTensorValueViews (
486
500
tensorName , responseData [ 'debug_op' ] ) ;
501
+ this . _setTopRightSpinnerState ( false ) ;
487
502
} else {
488
503
console . error (
489
504
'Invalid long-polling response type: ' , responseType ) ;
@@ -733,6 +748,7 @@ <h2>Continue...</h2>
733
748
if ( this . _activeSessionRunKey == null ) {
734
749
return ;
735
750
}
751
+ this . _setTopRightSpinnerState ( true ) ;
736
752
737
753
// First, check to see if any new device GraphDef(s) have arrived and if
738
754
// so, retrieve them.
@@ -787,6 +803,7 @@ <h2>Continue...</h2>
787
803
this . _continueToType = '' ;
788
804
this . _continueToTarget = '' ;
789
805
this . _continueToCounterTarget = - 1 ;
806
+ this . _setTopRightSpinnerState ( false ) ;
790
807
} ,
791
808
792
809
_topRightSelectedChanged ( topRightSelected ) {
@@ -835,6 +852,28 @@ <h2>Continue...</h2>
835
852
console . log ( 'Breakpoint set_state response: ' , response ) ;
836
853
} ) ;
837
854
} ,
855
+
856
+ _graphProgressUpdated ( progress ) {
857
+ const topRightProgressBar = this . $$ ( '#top-right-progress-bar' ) ;
858
+ if ( this . _latestSessionRun == null ) {
859
+ // No Session.run() has connected yet. Do not show the spinner(s) or
860
+ // the progress bar(s).
861
+ topRightProgressBar . setAttribute ( 'value' , 0 ) ;
862
+ this . _setTopRightSpinnerState ( false ) ;
863
+ } else {
864
+ topRightProgressBar . setAttribute ( 'value' , progress . value ) ;
865
+ this . _setTopRightSpinnerState ( progress . value < 100 ) ;
866
+ }
867
+ } ,
868
+
869
+ _setTopRightSpinnerState ( isActive ) {
870
+ const topRightSpinner = this . $$ ( '#top-right-spinner' ) ;
871
+ if ( isActive ) {
872
+ topRightSpinner . setAttribute ( 'active' , true ) ;
873
+ } else {
874
+ topRightSpinner . removeAttribute ( 'active' ) ;
875
+ }
876
+ }
838
877
} ) ;
839
878
840
879
tf_tensorboard . registerDashboard ( {
0 commit comments