load-and-wrap
Resolve TensorFlow Hub handles, load or wrap SavedModels with KerasLayer, and use the feature-column text embedding submodule safely.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- load-and-wrap
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Resolve TensorFlow Hub handles, load or wrap SavedModels with KerasLayer, and use the feature-column text embedding submodule safely.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/api-reference.md2.0 KB
- 参考文档references/feature-column-v2.md2.8 KB
- 参考文档references/keras-layer.md4.2 KB
- 参考文档references/load-resolve-cache.md3.9 KB
- 参考文档references/troubleshooting.md4.1 KB
- 脚本scripts/smoke_load_and_wrap.py6.1 KB
03 SKILL.md 正文
Load and Wrap
Use this sub-skill when the task is to inspect, resolve, or load a TensorFlow Hub handle, wrap a SavedModel with KerasLayer, or use the feature-column text embedding helper safely in current TensorFlow Hub workflows.
Do not use this sub-skill for exporting new SavedModels or text embedding modules. That workflow belongs to the sibling export-and-save route.
Quick routing
- Read references/api-reference.md for the verified public surface, import paths, and the APIs that are absent in this package version.
- Read references/load-resolve-cache.md when the issue is about local paths, smart HTTP/HTTPS handles, cache location, compressed versus uncompressed model load format, locks, descriptors, or archive validation.
- Read references/keras-layer.md when the issue is about
signature,signature_outputs_as_dict,output_key,output_shape,arguments,load_options, trainability, or Keras 3 /tf_kerascompatibility. - Read references/feature-column-v2.md when the issue is about
tensorflow_hub.feature_column_v2.text_embedding_column_v2,DenseFeatures, parse specs, or the top-levelAttributeErrorrecovery path. - Read references/troubleshooting.md when the symptom is an import failure, handle/path failure, cache/download lock problem, corrupt archive, signature mismatch,
trainable=Trueerror, or feature-column import mistake. - Run scripts/smoke_load_and_wrap.py for a local no-download sanity check. Add
--feature-columnwhen you also want to verify the feature-column path.
Quick workflow
- Decide whether the input is a local SavedModel directory, a remote handle, or an already-loaded callable object.
- If you need to inspect or normalize a handle, call
hub.resolve(handle)first. - If you need the raw loaded object, call
hub.load(handle)on a string handle. - If you need a Keras layer, wrap the handle with
hub.KerasLayer(...)and choose the right output-selection mode before training or serialization. - If you need text embeddings inside feature columns, import
tensorflow_hub.feature_column_v2directly and buildDenseFeaturesaround the returned column. - Validate the smallest possible local SavedModel with the bundled smoke script before touching any network-backed handle or large model.
Route notes
hub.loadandhub.resolveare string-handle APIs.KerasLayercan accept either a callable object or a string handle. Use the reference doc when you need to decide which one fits the export you have.- A SavedModel that only exposes a signature needs explicit output selection. A callable SavedModel usually does not.
trainable=Trueis not a general fix for signatures. If a model must be fine-tuned, the export has to support that path.- The feature-column helper is only available through the submodule import path in this package version.
Keep in scope
- Loading and wrapping existing TensorFlow Hub assets.
- Diagnosing how the current package interprets handles, signatures, outputs, and cache settings.
- Safe feature-column consumption of text embedding SavedModels.
Route elsewhere
- Exporting or refreshing a SavedModel, module, or embedding archive ->
export-and-save - Broader package install or import problems ->
references/troubleshooting.md - Any workflow that depends on a public symbol not listed in
references/api-reference.md
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).