(traj: torch.tensor, save_path: str)
| 93 | fout.write(text) |
| 94 | |
| 95 | def save_traj(traj: torch.tensor, save_path: str): |
| 96 | # Write the traj in the end of the txt file |
| 97 | txt_save_path = os.path.join(save_path, "text.txt") |
| 98 | traj = traj.cpu().numpy().tolist() |
| 99 | traj = traj[0] # * bs = 1 |
| 100 | with open(txt_save_path, "a") as fout: |
| 101 | fout.write("\n") |
| 102 | for waypoint in traj: |
| 103 | fout.write(str(waypoint) + "\n") |
| 104 | |
| 105 | def get_all_file_from_dir(dir, ext=".pt"): |
| 106 | out_files = [] |