extract positional info from src for all datatypes, e.g., for vehicles, the first two dimensions are x and y
(self, src, dyn_type)
| 41 | self.src2posfun = src2posfun |
| 42 | |
| 43 | def src2pos(self, src, dyn_type): |
| 44 | "extract positional info from src for all datatypes, e.g., for vehicles, the first two dimensions are x and y" |
| 45 | |
| 46 | pos = torch.zeros([*src.shape[:-1], 2]).to(src.device) |
| 47 | for dt, fun in self.src2posfun.items(): |
| 48 | pos += fun(src) * (dyn_type == dt).view([*(dyn_type.shape), 1, 1]) |
| 49 | |
| 50 | return pos |
| 51 | |
| 52 | def forward( |
| 53 | self, |