ConsDrive / utils /pim_types.py
ZenoNing's picture
Upload ConsDrive v2 source (part 2)
314ecfb verified
Raw History Blame Contribute Delete
680 Bytes
"""Stream metadata and training-only labels, deliberately separate from policy inputs."""
from typing import NamedTuple, List, Dict, Optional
from torch import Tensor
from utils.custom_types import DrivingExample
class PIMStreamBatch(NamedTuple):
frames: List[DrivingExample]
timestamps: Tensor # [B,T], episode-relative seconds
ego_poses: Tensor # [B,T,3], world x/y/yaw in radians
labels: List[Optional[Dict[str, Tensor]]]
class PIMStepOutput(NamedTuple):
speed_wps: Tensor
route: Tensor
state: object
diagnostics: Dict[str, Tensor]
action_features: Tensor
scene_tokens: Tensor
scene_mask: Tensor