tglite.Memory

class tglite.Memory(num_nodes: int, dim: int, device=None)

A container for node memory.

__init__(num_nodes: int, dim: int, device=None)

Internal constructor for creating a Memory. Initialize node memory and timestamps to zero.

Parameters:
  • num_nodes (int) – Number of nodes

  • dim (int) – Length of memory vector for a single node

  • device (None or str or torch.device) – Which device to put node memory

Methods

__init__(num_nodes, dim[, device])

Internal constructor for creating a Memory.

backup()

dim()

Return length of memory vector for a single node

move_to(device, **kwargs)

reset()

Reset node memory and timestamps to zero

restore(state)

update(nids, newdata, newtime)

Attributes

data

Return node memory

device

Return the device where Memory is located

time

Return timestamps of current node memory