MCPcopy Index your code
hub / github.com/OpenDriveLab/ReSim / save_traj

Function save_traj

sat/sample_video.py:95–103  ·  view source on GitHub ↗
(traj: torch.tensor, save_path: str)

Source from the content-addressed store, hash-verified

93 fout.write(text)
94
95def 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
105def get_all_file_from_dir(dir, ext=".pt"):
106 out_files = []

Callers 1

sampling_mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected