TensorLogger

lamp.data.TensorLogger$
See theTensorLogger companion class
object TensorLogger

Utility to periodically log active tensors See lamp.data.TensorLogger#start

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def detailAllTensorOptions(logger: String => Unit): Unit
def detailAllTensors(logger: String => Unit): Unit
def formatLine(data: TensorTraceData): String
def formatStackTrace(data: TensorTraceData): String
def logTensorOptions(logger: String => Unit, filter: (TensorTraceData, Double) => Boolean, detailMinMs: Double, detailMaxMs: Double, detailNum: Int): Unit
def logTensors(logger: String => Unit, filter: (TensorTraceData, Double) => Boolean, detailMinMs: Double, detailMaxMs: Double, detailNum: Int): Unit
def makeLog(nanoTime: Long, data: Seq[TensorTraceData], filter: (TensorTraceData, Double) => Boolean, detailMinMs: Double, detailMaxMs: Double, detailNum: Int): String
def makeStatistic(nanoTime: Long, actives: Seq[TensorTraceData])(filter: (TensorTraceData, Double) => Boolean): (List[(Double, Double, Int)], Seq[(TensorTraceData, Double)], Map[Boolean, Long])
def queryActiveTensorOptions(): Vector[TensorTraceData]
def queryActiveTensors(): Vector[TensorTraceData]
def start(frequency: FiniteDuration)(logger: String => Unit, filter: (TensorTraceData, Double) => Boolean, detailMinMs: Double, detailMaxMs: Double, detailNum: Int): TensorLogger

Log active tensors with a given frequency

Log active tensors with a given frequency

The log string itself consists of a summary statistics of active tensors and a list of detailed information on some number of active tensors. The detailed information shows the stack trace where the tensor was allocated. The tensors eligible for detail are specified by a filter on their lifetime.

This method will spawn a new Thread, which repeatedly logs and sleeps until not canceled.

Value parameters

detailMaxMs

maximum lifetime in milliseconds for a tensor to be eligible for detailed logging

detailMinMs

minimum lifetime in milliseconds for a tensor to be eligible for detailed logging

detailNum

max number of tensors in the detailed section

filter

a predicate taking some information about the tensor and the lifetime of the tensor in milliseconds

frequency

the frequency with which the logging will occur

logger

a side effecting lambda which executes the log

Attributes

Returns

an instance of TensorLogger whose sole purpose is its cancel() method which stops the logger