Spaces:
Paused
Paused
Weiyu Liu commited on
Commit ·
3827c6d
1
Parent(s): 824a79e
compute rot 6d does not depend on cuda
Browse filesFiles changed (4)
44 unmodified lines454647484950515253545516 unmodified lines7273747576777879808144 unmodified linesdef get_struct_objs_poses(x):on_gpu = x.is_cudaif not on_gpu:x = x.cuda()# assert x.is_cuda, "compute_rotation_matrix_from_ortho6d requires input to be on gpu"device = x.device# important: the noisy x can go out of bounds16 unmodified linesstruct_pose = x_full[:, 0].unsqueeze(1) # B, 1, 4, 4pc_poses_in_struct = x_full[:, 1:] # B, N, 4, 4if not on_gpu:struct_pose = struct_pose.cpu()pc_poses_in_struct = pc_poses_in_struct.cpu()return struct_pose, pc_poses_in_struct44 unmodified lines45464748495016 unmodified lines67686970717244 unmodified linesdef get_struct_objs_poses(x):device = x.device# important: the noisy x can go out of bounds16 unmodified linesstruct_pose = x_full[:, 0].unsqueeze(1) # B, 1, 4, 4pc_poses_in_struct = x_full[:, 1:] # B, N, 4, 4return struct_pose, pc_poses_in_struct
20 unmodified lines2122232425262720 unmodified linesdef normalize_vector( v, return_mag =False):batch=v.shape[0]v_mag = torch.sqrt(v.pow(2).sum(1))# batchv_mag = torch.max(v_mag, torch.autograd.Variable(torch.FloatTensor([1e-8]).cuda()))v_mag = v_mag.view(batch,1).expand(batch,v.shape[1])v = v/v_magif(return_mag==True):20 unmodified lines2122232425262720 unmodified linesdef normalize_vector( v, return_mag =False):batch=v.shape[0]v_mag = torch.sqrt(v.pow(2).sum(1))# batchv_mag = torch.max(v_mag, torch.autograd.Variable(torch.FloatTensor([1e-8]).to(v.device)))v_mag = v_mag.view(batch,1).expand(batch,v.shape[1])v = v/v_magif(return_mag==True):
src/StructDiffusion/diffusion/__pycache__/pose_conversion.cpython-38.pyc
src/StructDiffusion/diffusion/pose_conversion.py-9
src/StructDiffusion/utils/__pycache__/rotation_continuity.cpython-38.pyc
src/StructDiffusion/utils/rotation_continuity.py+1-1