unilab.tasks.motion_tracking.common.tensor_runtime

Reusable tensor-runtime pieces for motion-tracking task owners.

These helpers deliberately do not construct environments or discover backend capabilities. A task owner remains responsible for validating its semantic contract and negotiating UniSim’s public tensor lifecycle before using them.

Functions

semantic_fingerprint(domain, value)

Return a stable SHA-256 fingerprint for a task-owner semantic token.

semantic_token(value)

Normalize an owner configuration value without unknown escapes.

Classes

EpisodeMetrics

Device-resident current episode accumulators.

ObservationNoise

Uniform additive observation noise with owner-declared bounds.

ResetMasks

Device-side fixed-width done union.

class unilab.tasks.motion_tracking.common.tensor_runtime.EpisodeMetrics[source]

Bases: object

Device-resident current episode accumulators.

snapshot and finished_values return tensors; callers decide when a logging or IPC boundary is allowed to copy them to host.

Parameters:
rewards: Tensor
lengths: Tensor
classmethod create(num_envs, device)[source]
Parameters:
Return type:

EpisodeMetrics

update(reward, done)[source]
Parameters:
Return type:

None

finished_values(done_mask)[source]
Parameters:

done_mask (Tensor)

Return type:

Tensor

reset(done_mask)[source]
Parameters:

done_mask (Tensor)

Return type:

None

snapshot()[source]
Return type:

dict[str, Tensor]

__init__(rewards, lengths)
Parameters:
class unilab.tasks.motion_tracking.common.tensor_runtime.ObservationNoise[source]

Bases: object

Uniform additive observation noise with owner-declared bounds.

Parameters:
lower: Tensor
upper: Tensor
classmethod from_uniform_terms(terms, widths, device)[source]
Parameters:
Return type:

ObservationNoise

apply(observations, *, cursor, generator)[source]
Parameters:
Return type:

Tensor

__init__(lower, upper)
Parameters:
class unilab.tasks.motion_tracking.common.tensor_runtime.ResetMasks[source]

Bases: object

Device-side fixed-width done union.

Parameters:
terminated: Tensor
truncated: Tensor
property done: Tensor
__init__(terminated, truncated)
Parameters:
unilab.tasks.motion_tracking.common.tensor_runtime.semantic_fingerprint(domain, value)[source]

Return a stable SHA-256 fingerprint for a task-owner semantic token.

Parameters:
Return type:

str

unilab.tasks.motion_tracking.common.tensor_runtime.semantic_token(value)[source]

Normalize an owner configuration value without unknown escapes.

Parameters:

value (Any)

Return type:

Any