l5kit.dataset.utils module¶
- l5kit.dataset.utils.convert_str_to_fixed_length_tensor(string: str, max_length: int = 70) torch.Tensor ¶
Converts a string into a fixed length tensor of type torch.uint8.
- Parameters
string (str) – String to convert
max_length (int) – Fixed length, default kMaxStrLength
- Returns
A fixed length tensor of type torch.uint8 that encodes the string
- Return type
torch.Tensor
- l5kit.dataset.utils.move_to_device(data: Dict[str, torch.Tensor], device: torch.device) Dict[str, torch.Tensor] ¶
Move the data dict to a given torch device
- Parameters
data – the torch dict
device – the device where to move each value of the dict
- Returns
the torch dict on the new device
- l5kit.dataset.utils.move_to_numpy(data: Dict[str, torch.Tensor]) Dict[str, numpy.ndarray] ¶
Move a torch dict into numpy (on cpu)
- Parameters
data – the torch dict
- Returns
the numpy dict