tglite.TContext

class tglite.TContext(g: TGraph)

Graph-level context and scratch space used by the tglite runtime.

__init__(g: TGraph)

Internal constructor for creating a TContext.

Parameters:

g (TGraph) – The TGraph to operate on.

Basic settings

train()

Enables training mode and clear time tables and embedding cache tables.

eval()

Disables training mode.

need_sampling(need)

Creates tcsr within the TGraph if sampling is needed.

Set node embedding cache

enable_embed_caching(enabled[, dim_embed])

Performs embedding cache settings and clear cache tables.

set_cache_limit(limit)

Sets embedding cache limit and clear cache tables.

Set time precomputation

enable_time_precompute(enabled)

Performs time precomputation settings and clear time tables.

set_time_window(window)

Sets length of time window and clear time tables.

Query graph

graph

Returns the TGraph it associated with.