TensorBoard is a suite of web applications for inspecting and understanding your TensorFlow runs and graphs
TensorBoard's summary module provides access to summary writing infrastructure for creating TensorBoard logs. It re-exports summary operations from v1 and v2 APIs and provides writer classes for programmatic data logging. The module serves as the central entry point for TensorBoard's summary functionality.
TensorBoard re-exports v2 summary operations from the TensorFlow summary API.
# Re-exported from tensorboard.summary.v2
# (actual implementations depend on TensorFlow installation)
from tensorboard.summary.v2 import *Note: The v2 API functions are conditionally imported and depend on TensorFlow being available. When TensorFlow is not installed, these functions may not be available.
Core TensorBoard writer infrastructure for programmatic summary data writing.
class Writer:
"""
Summary data writer for programmatic logging.
Provides interface for writing summary data with explicit control
over output destinations and buffering.
"""
def __init__(self, output):
"""
Initialize Writer with output destination.
Args:
output (Output or str): Output instance or directory path
"""
class Output:
"""
Abstract base class for summary output destinations.
Defines the interface for writing summary data to various targets.
"""
class DirectoryOutput(Output):
"""
File system output implementation.
Writes summary data to TensorBoard event files in specified directory.
"""
def __init__(self, path):
"""
Initialize DirectoryOutput.
Args:
path (str): Directory path for log files
"""TensorBoard re-exports v1 summary operations from the TensorFlow v1 summary API.
# Re-exported from tensorboard.summary.v1
# (actual implementations depend on TensorFlow installation)
from tensorboard.summary.v1 import *Note: The v1 API functions are conditionally imported and depend on TensorFlow being available. When TensorFlow is not installed, these functions may not be available.
import tensorboard.summary as tb_summary
# Access writer classes
writer = tb_summary.Writer(tb_summary.DirectoryOutput('./logs'))# Re-exported from tensorboard.summary.v2 (requires TensorFlow)
try:
from tensorboard.summary.v2 import scalar, histogram
scalar('loss', 0.1, step=1)
histogram('weights', model_weights, step=1)
except ImportError:
print("TensorFlow not available - v2 summary API unavailable")from tensorboard.summary import Writer, DirectoryOutput
# Create writer with directory output
output = DirectoryOutput('./logs/experiment')
writer = Writer(output)
# Use writer for custom summary operations
# (specific writer methods depend on implementation)# Re-exported from tensorboard.summary.v1 (requires TensorFlow)
try:
from tensorboard.summary.v1 import scalar, histogram
# Use v1 API functions
except ImportError:
print("TensorFlow not available - v1 summary API unavailable")The summary module serves as TensorBoard's central entry point for summary operations, providing access to both v1/v2 APIs (when TensorFlow is available) and core writer infrastructure for programmatic logging.
Install with Tessl CLI
npx tessl i tessl/pypi-tensorboard