imate.Memory.start#

Memory.start()#

Sets the start points to track the memory change.

Note

This method should be called before calling imate.Memory.read().

Examples

>>> # Create an object of Memory class
>>> from imate import Memory
>>> mem = Memory()

>>> # Create a matrix
>>> from imate import toeplitz, logdet
>>> A = toeplitz(2, 1, size=1000, gram=True)

>>> # Start tracking memory change from here
>>> mem.start()

>>> # Compute the log-determinant of the matrix
>>> ld = logdet(A)

>>> # Read acquired memory is acquired from start to this point
>>> mem.read()
(679936, 'b')

>>> # Or, read acquired memory in human-readable format
>>> mem.read(human_readable=True)
(664.0, 'Kb')