forked from tensorflow/hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate TF docs based on latest TF-Hub push.
PiperOrigin-RevId: 209572025
- Loading branch information
1 parent
e8344e4
commit 3fe5793
Showing
16 changed files
with
181 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<div itemscope itemtype="http://developers.google.com/ReferenceObject"> | ||
<meta itemprop="name" content="hub.attach_message" /> | ||
<meta itemprop="path" content="stable" /> | ||
</div> | ||
|
||
# hub.attach_message | ||
|
||
``` python | ||
hub.attach_message( | ||
key, | ||
message | ||
) | ||
``` | ||
|
||
Adds an attached message to the module definition. | ||
|
||
NOTE: This must be called within a `module_fn` that is defining a Module. | ||
|
||
See ModuleSpec.get_attached_message() for an introduction to attached messages | ||
and the API for module consumers. | ||
|
||
To define a new type of attached message: | ||
|
||
* Select a reasonably descriptive name as a unique key. For now, keys must | ||
be valid Python identifiers that start with a letter. Punctuation besides | ||
underscores ('_') is reserved for future use in hierarchical names. | ||
|
||
* Define a Protocol Buffer message type to store the value for the key. | ||
(Use generic containers like google.protobuf.Value only if running | ||
the protocol compiler is infeasible for your build process.) | ||
|
||
* For module consumers, consider providing a small library that encapsulates | ||
the specific call to get_attached_message() behind a higher-level | ||
interface and supplies the right message type for parsing. | ||
|
||
Attached messages work best for few messages of moderate size. | ||
Avoid a large number of messages; use repetition within messages instead. | ||
Avoid large messages (megabytes); consider module assets instead. | ||
|
||
For modules with multiple graph versions, each graph version stores separately | ||
what was attached from within the call to `module_fn` that defines its graph. | ||
|
||
#### Args: | ||
|
||
* <b>`key`</b>: A string with the unique key to retrieve this message. Must start | ||
with a letter and contain only letters, digits and underscores. If used | ||
repeatedly within one invocation of `module_fn`, then only the message | ||
from the final call will be returned by `get_attached_message()`. | ||
* <b>`message`</b>: A protocol message object, to be stored in serialized form. | ||
|
||
|
||
#### Raises: | ||
|
||
* <b>`ValueError`</b>: if `key` is not a string of the form of a Python identifier. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
docs/api_docs/python/hub/create_module_spec_from_saved_model.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<div itemscope itemtype="http://developers.google.com/ReferenceObject"> | ||
<meta itemprop="name" content="hub.create_module_spec_from_saved_model" /> | ||
<meta itemprop="path" content="stable" /> | ||
</div> | ||
|
||
# hub.create_module_spec_from_saved_model | ||
|
||
``` python | ||
hub.create_module_spec_from_saved_model( | ||
saved_model_path, | ||
drop_collections=None | ||
) | ||
``` | ||
|
||
Experimental: Create a ModuleSpec out of a SavedModel. | ||
|
||
Define a ModuleSpec from a SavedModel. Note that this is not guaranteed to | ||
work in all cases and it assumes the SavedModel has followed some conventions: | ||
|
||
- The serialized SaverDef can be ignored and instead can be reconstructed. | ||
- The init op and main op can be ignored and instead the module can be | ||
initialized by using the conventions followed by | ||
`tf.train.MonitoredSession`. | ||
|
||
Note that the set of features supported can increase over time and have side | ||
effects that were not previously visible. The pattern followed to avoid | ||
surprises is forcing users to declare which features to ignore (even | ||
if they are not supported). | ||
|
||
Note that this function creates a ModuleSpec that when exported exports a | ||
Module (based on a modified copy of the original SavedModel) and not a | ||
SavedModel. | ||
|
||
#### Args: | ||
|
||
* <b>`saved_model_path`</b>: Directory with the SavedModel to use. | ||
* <b>`drop_collections`</b>: Additionally list of collection to drop. | ||
|
||
|
||
#### Returns: | ||
|
||
A ModuleSpec. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters