MemoryTracker

Tracks memory allocation events and reports aggregate statistics across all live TensorStorage instances.

Use record to log storage creation, and report to get a snapshot of current memory usage. This is primarily for debugging and regression testing (e.g., "assert no unexpected copies in this inference pass").

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun clear()

Reset all tracked entries.

Link copied to clipboard
fun record(name: String, storage: TensorStorage)

Record a tensor storage allocation.

Link copied to clipboard
fun recordCopy(sourceName: String, bytes: Long)

Record an explicit copy event (for copy-tracing).

Link copied to clipboard

Generate an aggregate memory report.