float_runtime
float_runtime
¶
Floating-point policy inference runtime.
FloatPolicyRuntime
¶
Bases: PolicyRuntime
Inference runtime for floating-point policy checkpoints.
Initialize the float policy runtime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device
|
device
|
Device to load the model onto. |
required |
checkpoint_path
|
str
|
Path to the checkpoint directory. |
required |
checkpoint_name
|
str
|
Name of the checkpoint file. |
value
|
seed
|
int
|
Random seed for reproducibility. |
42
|
compile_model
|
bool
|
Whether to compile the policy with torch.compile for optimized inference. |
True
|
Source code in src/versatil/inference/policy_runtime/float_runtime.py
run_inference
¶
Run policy inference with autocast and no_grad.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obs_dict
|
dict[str, Tensor]
|
Observation dictionary for the policy. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Tensor]
|
Action dictionary from policy.predict_action. |