You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ADDING_A_PLUGIN.md
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,6 @@ The backend and frontend operate within a plugin lifecycle:
32
32
33
33
-**4) Plugin handles routes**: When a plugin's frontend makes URL requests to its backend, route handlers can respond with collected data.
34
34
35
-
36
35
### Backend: How the plugin processes data, and sends it to the browser
37
36
38
37
#### Terminology
@@ -72,6 +71,7 @@ class MyPlugin(base_plugin.TBPlugin):
72
71
```
73
72
74
73
#### TBPlugin
74
+
75
75
-`plugin_name`: Required field used as a unique ID for the plugin. This must only contain alphanumeric characters, hyphens, and underscores.
76
76
-`get_plugin_apps()`: This should return a `dict` mapping route paths to WSGI applications: e.g., `"/tags"` might map to `self._serve_tags`.
77
77
-`is_active()`: This should return whether the plugin is active (whether there exists relevant data for the plugin to process). TensorBoard will hide inactive plugins from the main navigation bar. We strongly recommend this to be a cheap operation.
@@ -99,14 +99,13 @@ class MyLoader(base_plugin.TBLoader):
99
99
```
100
100
101
101
#### TBLoader
102
+
102
103
-`define_flags(parser)`: Optional method that takes an argparse.Namespace and exposes command-line flags. Please prefix flags with the name of the plugin to avoid collision.
103
104
-`fix_flags(flags)`: Optional method needed to fix or sanitize command-line flags.
104
105
-`load(context)`: Required method that takes a TBContext and returns a TBPlugin instance.
105
106
106
107
It's recommended that plugins using flags call the `parser.add_argument_group(plugin_name)`. To learn more about the flag definition, see [docs](https://docs.python.org/library/argparse.html#adding-arguments)
107
108
108
-
109
-
110
109
## Reading data from event files
111
110
112
111
On instantiation, a plugin is provided a [`PluginEventMultiplexer`] object as a field on the TBContext, from which to read data. The `PluginRunToTagToContent` method on the multiplexer returns a dictionary containing all run–tag pairs and associated summary metadata for your plugin.
@@ -164,7 +163,6 @@ Consistency in user interface and experience, we believe, is important for happy
164
163
165
164
We recommend that you vendor all resources required to use your plugin, including scripts, stylesheets, fonts, and images. All built-in TensorBoard plugins follow this policy.
166
165
167
-
168
166
### Summaries: How the plugin gets data
169
167
170
168
Your plugin will need to provide a way for users to log **summaries**, which are the mechanism for getting data from a TensorFlow model to disk and eventually into your TensorBoard plugin for visualization. For example, the example plugin provides a novel [“greeting” TensorFlow op][greeting-op] that writes greeting summaries. A summary is a protocol buffer with the following information:
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,13 @@ Follow either of the two links above to access the appropriate CLA and instructi
11
11
12
12
***NOTE***: Only original source code from you and other people that have signed the CLA can be accepted into the main repository.
13
13
14
-
15
14
### Working with the team
15
+
16
16
If you're planning a larger contribution, please get in touch with the team through a GitHub issue before starting work - we can help guide you, and coordinating up front will make the process smoother.
17
17
18
18
If you want to add a major feature, it may be a good candidate for adding a plugin. Let us know via a GitHub issue, and we can guide you in the process.
19
19
20
20
### Code reviews
21
+
21
22
All submissions, including submissions by project members, require review. We
0 commit comments