dgs.utils.track.Track¶
- class dgs.utils.track.Track(N: int, curr_frame: int, states: list[State] | None = None, tid: int = -1)[source]¶
A Track is a single (de-)queue containing multiple
State
s, keeping the last N states.- Parameters:
N – The max length of this track.
states – A list of
State
objects, describing the initial values of this track. Default None.tid – The Track ID of this object. Default -1.
- __init__(N: int, curr_frame: int, states: list[State] | None = None, tid: int = -1) None [source]¶
Methods
age
(curr_frame)Get the age of this track (in frames).
append
(state)Append a new state to the Track.
clear
()Clear all the states from the Track.
copy
()Return a (deep) copy of self.
get_all
()Get all the states from the Track and stack them into a single
State
.Set the status of this Track to inactive and clean up older states.
set_reactivated
(tid)set_status
(status[, tid])Set the status of this Track.
to
(*args, **kwargs)Call
.to()
like you do with any othertorch.Tensor
.Attributes
Get the max length of this Track.
Get the device of every tensor in this Track.