Agent skill

Tensorflow Guide

by wentorai in wentorai/research-plugins

TensorFlow best practices for tf.function, GPU memory, and deployment

MITAuto-check passedAI & LLM Engineering

Install Tensorflow Guide

skills CLI
$ npx skills add wentorai/research-plugins --skill tensorflow-guide -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wentorai/research-plugins tensorflow-guide --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/domains/ai-ml/tensorflow-guide .claude/skills/tensorflow-guide && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tensorflow-guide
GitHub stars
298
Used in
1 other repo
Token cost
~2k tokens
SKILL.md length
299 words
Files
1
Skills in repo
428
Repo updated
First seen
Licence
MIT

At a glance

TensorFlow best practices for tf.function, GPU memory, and deployment

  • Tasks that involve Deep learning
  • SKILL.md covers Overview, tf.function: The Critical…, GPU Memory Management and Distributed Training Strategies, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Tensorflow Guide is an agent skill from wentorai/research-plugins. TensorFlow best practices for tf.function, GPU memory, and deployment

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Deep learning. It works with TensorFlow. The repository describes itself as: 350+ academic research skills, MCP configs, and plugins for Research-Claw and AI agents. The licence is MIT.

When your agent uses it

  • Tasks that involve Deep learning

Example prompts

  • “/tensorflow-guide”

Requirements

  • Python 3
  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit bf44b3c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • tensorflow.org
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tensorflow Guide loads about 2k tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 299 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~22
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wentorai/research-plugins at commit bf44b3c, republished under its MIT licence (© wentorai). 299 words, ~2,018 tokens.

Download SKILL.mdSave it as .claude/skills/tensorflow-guide/SKILL.md (or your agent's skills folder).
name
tensorflow-guide
description
TensorFlow best practices for tf.function, GPU memory, and deployment

TensorFlow Guide

Overview

TensorFlow is a production-grade machine learning framework that excels at deployment, distributed training, and hardware acceleration. While PyTorch dominates pure research prototyping, TensorFlow remains the standard in industry ML systems and is heavily used in applied research where models must move from experiment to production.

TensorFlow 2.x unified eager execution with graph-mode performance through tf.function, but this hybrid approach introduces subtle pitfalls. Understanding when and how TensorFlow traces functions, manages GPU memory, and distributes computation is essential for writing correct and efficient code.

This guide covers the key patterns that trip up researchers: tf.function tracing semantics, GPU memory management, distributed strategies, model export, and the ecosystem of tools (TFX, TensorBoard, TF Serving) that make TensorFlow uniquely powerful for end-to-end ML workflows.

tf.function: The Critical Abstraction

How Tracing Works
python
import tensorflow as tf

@tf.function
def add(a, b):
    print("Tracing!")  # Runs only during tracing, NOT every call
    tf.print("Executing!")  # Runs every call (TF op)
    return a + b

# First call with float32 shape (2,) -- traces
add(tf.constant([1.0, 2.0]), tf.constant([3.0, 4.0]))  # Prints "Tracing!" + "Executing!"

# Second call with same signature -- reuses trace
add(tf.constant([5.0, 6.0]), tf.constant([7.0, 8.0]))  # Prints only "Executing!"

# Third call with different dtype -- re-traces!
add(tf.constant([1, 2]), tf.constant([3, 4]))  # Prints "Tracing!" + "Executing!"
Common tf.function Pitfalls
python
# PITFALL 1: Python side effects in tf.function
counter = 0

@tf.function
def increment():
    global counter
    counter += 1  # Only runs during tracing! counter stays at 1 forever.
    return counter

# FIX: Use tf.Variable for mutable state
counter = tf.Variable(0)

@tf.function
def increment():
    counter.assign_add(1)
    return counter

# PITFALL 2: Creating variables inside tf.function
@tf.function
def bad_function(x):
    w = tf.Variable(tf.random.normal([3, 3]))  # ERROR on second call!
    return x @ w

# FIX: Create variables outside, pass as arguments or use Keras layers
w = tf.Variable(tf.random.normal([3, 3]))

@tf.function
def good_function(x):
    return x @ w

# PITFALL 3: Python lists that grow
@tf.function
def bad_accumulate(dataset):
    results = []
    for x in dataset:
        results.append(x * 2)  # Creates new trace on every iteration!
    return results

# FIX: Use tf.TensorArray
@tf.function
def good_accumulate(dataset):
    results = tf.TensorArray(tf.float32, size=0, dynamic_size=True)
    for i, x in enumerate(dataset):
        results = results.write(i, x * 2)
    return results.stack()
Input Signatures for Stable Tracing
python
@tf.function(input_signature=[
    tf.TensorSpec(shape=[None, 224, 224, 3], dtype=tf.float32),
    tf.TensorSpec(shape=[None], dtype=tf.int64),
])
def train_step(images, labels):
    """Fixed signature prevents re-tracing on different batch sizes."""
    with tf.GradientTape() as tape:
        predictions = model(images, training=True)
        loss = loss_fn(labels, predictions)
    gradients = tape.gradient(loss, model.trainable_variables)
    optimizer.apply_gradients(zip(gradients, model.trainable_variables))
    return loss

GPU Memory Management

python
# Problem: TensorFlow grabs ALL GPU memory by default
# Solution: Enable memory growth

gpus = tf.config.list_physical_devices("GPU")
for gpu in gpus:
    tf.config.experimental.set_memory_growth(gpu, True)

# Alternative: Set a hard memory limit
tf.config.set_logical_device_configuration(
    gpus[0],
    [tf.config.LogicalDeviceConfiguration(memory_limit=8192)]  # 8 GB
)

# Monitor memory usage
print(tf.config.experimental.get_memory_info("GPU:0"))

Distributed Training Strategies

StrategyGPUsMachinesSyncUse Case
MirroredStrategyMultiple1SyncMost common multi-GPU
MultiWorkerMirroredStrategyMultipleMultipleSyncMulti-node training
TPUStrategyTPU cores1 podSyncTPU training
ParameterServerStrategyMultipleMultipleAsyncVery large models
python
# Multi-GPU training with MirroredStrategy
strategy = tf.distribute.MirroredStrategy()
print(f"Number of devices: {strategy.num_replicas_in_sync}")

with strategy.scope():
    model = build_model()
    model.compile(
        optimizer=tf.keras.optimizers.Adam(learning_rate=0.001 * strategy.num_replicas_in_sync),
        loss="sparse_categorical_crossentropy",
        metrics=["accuracy"],
    )

# Global batch size = per_replica_batch * num_replicas
global_batch_size = 32 * strategy.num_replicas_in_sync
dataset = dataset.batch(global_batch_size)
model.fit(dataset, epochs=10)

Model Export and Serving

python
# SavedModel: The universal export format
model.save("saved_model/my_model")

# Load with full TF capabilities
loaded = tf.saved_model.load("saved_model/my_model")
infer = loaded.signatures["serving_default"]

# TF Lite for mobile/edge deployment
converter = tf.lite.TFLiteConverter.from_saved_model("saved_model/my_model")
converter.optimizations = [tf.lite.Optimize.DEFAULT]
tflite_model = converter.convert()

with open("model.tflite", "wb") as f:
    f.write(tflite_model)

# TensorFlow.js for browser deployment
# Command line:
# tensorflowjs_converter --input_format=tf_saved_model saved_model/my_model web_model/

Performance Optimization with XLA

python
# XLA (Accelerated Linear Algebra) compiles tf.functions for hardware
@tf.function(jit_compile=True)
def fast_matmul(a, b):
    return tf.matmul(a, b)

# Enable XLA globally for Keras
tf.config.optimizer.set_jit(True)

# Benchmark XLA vs non-XLA
import time
a = tf.random.normal([1024, 1024])
b = tf.random.normal([1024, 1024])

# Warm up
fast_matmul(a, b)

start = time.time()
for _ in range(1000):
    fast_matmul(a, b)
print(f"XLA matmul: {time.time() - start:.3f}s")

Debugging and Profiling

python
# Enable eager mode for debugging
tf.config.run_functions_eagerly(True)

# TensorBoard profiler integration
log_dir = "logs/profile"
tf.profiler.experimental.start(log_dir)
# ... run training steps ...
tf.profiler.experimental.stop()
# View: tensorboard --logdir logs/profile

# Check for numerical issues
tf.debugging.enable_check_numerics()  # Raises on NaN/Inf

Best Practices

  • Set memory growth before any TF operations. It must be the first GPU-related call.
  • Use tf.function with explicit input_signature to prevent re-tracing in production.
  • Avoid Python control flow inside tf.function unless you use tf.cond / tf.while_loop.
  • Profile with TensorBoard before optimizing; identify whether you are CPU-bound, GPU-bound, or I/O-bound.
  • Use mixed precision via tf.keras.mixed_precision.set_global_policy("mixed_float16") for modern GPUs.
  • Pin TF version in Docker images for reproducible research -- different versions can produce different numerical results.

References

© wentorai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/domains/ai-ml/tensorflow-guide of wentorai/research-plugins.

Open the folder on GitHubat commit bf44b3c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in wentorai/research-plugins, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Tensorflow Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tensorflow Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tensorflow Guide this skillwentorai/research-plugins2981 repos~2kAutomated safety check: PassMIT
Ray Train Distributed TrainingOrchestra-Research/AI-Research-SKILLs13k3 repos~2.7kAutomated safety check: PassMIT
TensorBoard Training VisualizationOrchestra-Research/AI-Research-SKILLs13k3 repos~3.8kAutomated safety check: PassMIT
Technology Selectiondotnet/skills5.6k2 repos~2.1kAutomated safety check: PassMIT
ML Engineerdavila7/claude-code-templates32k9 repos~2.3kAutomated safety check: PassMIT
Sandbox Tfjsnodetool-ai/nodetool554—~660Automated safety check: PassAGPL-3.0

Similar skills

  • Ray Train Distributed Training

    Orchestra-Research/AI-Research-SKILLs

    Scales PyTorch, TensorFlow and Hugging Face training from a single GPU to multi-node clusters with Ray Train, including Ray Tune sweeps and checkpoint recovery.

    13k GitHub starsUsed in 3 repos~2.7k tokens
    AI & LLM EngineeringAuto-check passed
  • TensorBoard Training Visualization

    Orchestra-Research/AI-Research-SKILLs

    Covers logging and viewing training metrics, histograms, model graphs, embeddings and profiles with TensorBoard in PyTorch and TensorFlow projects.

    13k GitHub starsUsed in 3 repos~3.8k tokens
    AI & LLM EngineeringAuto-check passed
  • Official

    Guides technology selection and implementation of AI and ML features in .NET 8+ applications using ML.NET, Microsoft.Extensions.AI (MEAI), Microsoft Agent Framework (MAF), GitHub Copilot SDK, ONNX…

    5.6k GitHub starsUsed in 2 repos~2.1k tokens
    AI & LLM EngineeringAuto-check passed
  • ML Engineer

    davila7/claude-code-templates

    Build production ML systems with PyTorch 2.x, TensorFlow, and modern ML frameworks.

    32k GitHub starsUsed in 9 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Sandbox Tfjs

    nodetool-ai/nodetool

    Classify and embed images, detect objects, and answer from a passage in a Code node or CodeAct action, with TensorFlow.js running on the host

    554 GitHub stars~660 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Deepctr

    VectorSpaceLab/AREX-Skill

    Use this DeepCTR repo skill for CTR/recommender feature columns, Keras models, sequence/session models, multitask models, and legacy TensorFlow Estimator workflows.

    328 GitHub stars~630 tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

More from wentorai/research-plugins

All 428 skills in this repo
  • Abstract Writing Guide

    wentorai/research-plugins

    Craft structured research abstracts that maximize clarity and journal acceptance

    298 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Academic Citation Manager

    wentorai/research-plugins

    Manage academic citations across BibTeX, APA, MLA, and Chicago formats

    298 GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Academic Paper Summarizer

    wentorai/research-plugins

    Summarize academic papers with structured extraction of key elements

    298 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Academic Study Methods

    wentorai/research-plugins

    Evidence-based study techniques for academic learning and retention

    298 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Academic Tone Guide

    wentorai/research-plugins

    Adjust writing tone and register for academic audiences and venues

    298 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Academic Translation Guide

    wentorai/research-plugins

    Academic translation, post-editing, and Chinglish correction guide

    298 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed

Works with

Questions about Tensorflow Guide

What does Tensorflow Guide do?

TensorFlow best practices for tf.function, GPU memory, and deployment. Tensorflow Guide is an agent skill from wentorai/research-plugins.

When should I use Tensorflow Guide?

Tensorflow Guide fits situations like: tasks that involve Deep learning.

How do I install Tensorflow Guide in Claude Code?

Run `npx skills add wentorai/research-plugins --skill tensorflow-guide -a claude-code`. Or copy the skill folder (skills/domains/ai-ml/tensorflow-guide in wentorai/research-plugins) into .claude/skills/tensorflow-guide in your project. Claude Code loads it when a task matches its description.

How do I install Tensorflow Guide in Codex?

Run `npx skills add wentorai/research-plugins --skill tensorflow-guide -a codex`. Or copy the skill folder (skills/domains/ai-ml/tensorflow-guide in wentorai/research-plugins) into .agents/skills/tensorflow-guide in your project. Codex loads it when a task matches its description.

Can I use Tensorflow Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wentorai/research-plugins --skill tensorflow-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tensorflow-guide, .gemini/skills/tensorflow-guide, .github/skills/tensorflow-guide and .opencode/skills/tensorflow-guide in your project.

What does Tensorflow Guide need to run?

SKILL.md names no scripts, command-line tools or credentials: Tensorflow Guide is instructions for the agent only. Our summary lists: Python 3; Docker.

Does Tensorflow Guide access the network?

SKILL.md names 2 domains. As links in the text: tensorflow.org and github.com. This is read from the text; nothing was executed.

Is Tensorflow Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tensorflow Guide use?

Tensorflow Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tensorflow Guide use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tensorflow Guide?

Skills that share tags, products or a category with Tensorflow Guide: Ray Train Distributed Training (Orchestra-Research/AI-Research-SKILLs, 13k stars), TensorBoard Training Visualization (Orchestra-Research/AI-Research-SKILLs, 13k stars), Technology Selection (dotnet/skills, 5.6k stars) and ML Engineer (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tensorflow Guide?

wentorai (a GitHub user) maintains it in wentorai/research-plugins, which has 298 GitHub stars. The repository holds 428 skills in this directory. The repository was last updated on June 19, 2026.

Source: wentorai/research-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.