71
71
_VALID_PLUGIN_RE = re .compile (r'^[A-Za-z0-9_.-]+$' )
72
72
73
73
74
+ def tensor_size_guidance_from_flags (flags ):
75
+ """Apply user per-summary size guidance overrides."""
76
+
77
+ tensor_size_guidance = dict (DEFAULT_TENSOR_SIZE_GUIDANCE )
78
+ if not flags or not flags .samples_per_plugin :
79
+ return tensor_size_guidance
80
+
81
+ for token in flags .samples_per_plugin .split (',' ):
82
+ k , v = token .strip ().split ('=' )
83
+ tensor_size_guidance [k ] = int (v )
84
+
85
+ return tensor_size_guidance
86
+
87
+
74
88
def standard_tensorboard_wsgi (
75
89
logdir ,
76
90
purge_orphaned_data ,
@@ -90,13 +104,13 @@ def standard_tensorboard_wsgi(
90
104
reload_interval: The interval at which the backend reloads more data in
91
105
seconds. Zero means load once at startup; negative means never load.
92
106
plugins: A list of constructor functions for TBPlugin subclasses.
93
- path_prefix: A prefix of the path when app isn't served from root.
94
107
db_uri: A String containing the URI of the SQL database for persisting
95
108
data, or empty for memory-only mode.
96
109
assets_zip_provider: See TBContext documentation for more information.
97
110
If this value is not specified, this function will attempt to load
98
111
the `tensorboard.default` module to use the default. This behavior
99
112
might be removed in the future.
113
+ path_prefix: A prefix of the path when app isn't served from root.
100
114
window_title: A string specifying the the window title.
101
115
max_reload_threads: The max number of threads that TensorBoard can use
102
116
to reload runs. Not relevant for db mode. Each thread reloads one run
@@ -110,7 +124,7 @@ def standard_tensorboard_wsgi(
110
124
assets_zip_provider = default .get_assets_zip_provider ()
111
125
multiplexer = event_multiplexer .EventMultiplexer (
112
126
size_guidance = DEFAULT_SIZE_GUIDANCE ,
113
- tensor_size_guidance = DEFAULT_TENSOR_SIZE_GUIDANCE ,
127
+ tensor_size_guidance = tensor_size_guidance_from_flags ( flags ) ,
114
128
purge_orphaned_data = purge_orphaned_data ,
115
129
max_reload_threads = max_reload_threads )
116
130
db_module , db_connection_provider = get_database_info (db_uri )
0 commit comments